%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/node_modules/node-modules/node_modules/request/tests/
Upload File :
Create Path :
Current File : //usr/local/lib/node_modules/node-modules/node_modules/request/tests/test-errors.js

var server = require('./server')
  , events = require('events')
  , assert = require('assert')
  , request = require('../index')
  ;

var local = 'http://localhost:8888/asdf'

try {
  request({uri:local, body:{}})
  assert.fail("Should have throw") 
} catch(e) {
  assert.equal(e.message, 'Argument error, options.body.')
}

try {
  request({uri:local, multipart: 'foo'})
  assert.fail("Should have throw")
} catch(e) {
  assert.equal(e.message, 'Argument error, options.multipart.')
}

try {
  request({uri:local, multipart: [{}]})
  assert.fail("Should have throw")
} catch(e) {
  assert.equal(e.message, 'Body attribute missing in multipart.')
}

try {
  request(local, {multipart: [{}]})
  assert.fail("Should have throw")
} catch(e) {
  assert.equal(e.message, 'Body attribute missing in multipart.')
}

console.log("All tests passed.")

Zerion Mini Shell 1.0