Sha256: 733b3eb846c8b2e3bc234fe13339640c5909600c5e38471b2b841dc420f27525

Contents?: true

Size: 842 Bytes

Versions: 19

Compression:

Stored size: 842 Bytes

Contents

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.")

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ela-4.1.6 node_modules/request/tests/test-errors.js
ela-4.1.5 node_modules/request/tests/test-errors.js
ela-4.1.4 node_modules/request/tests/test-errors.js
ela-4.1.3 node_modules/request/tests/test-errors.js
ela-4.1.2 node_modules/request/tests/test-errors.js
ela-4.1.1 node_modules/request/tests/test-errors.js
ela-4.1.0 node_modules/request/tests/test-errors.js
ela-4.0.0 node_modules/request/tests/test-errors.js
ela-3.4.3 node_modules/request/tests/test-errors.js
ela-3.4.2 node_modules/request/tests/test-errors.js
ela-3.4.0 node_modules/request/tests/test-errors.js
ela-3.3.1 node_modules/request/tests/test-errors.js
ela-3.3.0 node_modules/request/tests/test-errors.js
ela-3.2.0 node_modules/request/tests/test-errors.js
ela-3.1.1 node_modules/request/tests/test-errors.js
ela-3.1.0 node_modules/request/tests/test-errors.js
ela-3.0.0 node_modules/request/tests/test-errors.js
ela-2.0.0 node_modules/request/tests/test-errors.js
ela-1.1.0 node_modules/request/tests/test-errors.js