Sha256: b6dd767152ddb4743af6f3dd0a9112d3341a190b55ce57e3b44e7bfe1e396533

Contents?: true

Size: 844 Bytes

Versions: 7

Compression:

Stored size: 844 Bytes

Contents

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

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

7 entries across 7 versions & 2 rubygems

Version Path
vulcan-0.8.2 server/node_modules/cradle/node_modules/request/tests/test-errors.js
vulcan-0.8.1 server/node_modules/cradle/node_modules/request/tests/test-errors.js
iron_worker_ng-0.10.1 iron_worker_examples/binary/phantom-nodejs/node_modules/iron_worker/node_modules/iron_core/node_modules/request/tests/test-errors.js
vulcan-0.8.0 server/node_modules/cradle/node_modules/request/tests/test-errors.js
vulcan-0.7.2 server/node_modules/cradle/node_modules/request/tests/test-errors.js
vulcan-0.7.1 server/node_modules/cradle/node_modules/request/tests/test-errors.js
vulcan-0.7.0 server/node_modules/cradle/node_modules/request/tests/test-errors.js