1 var server = require('./server')
2 , events = require('events')
3 , assert = require('assert')
4 , request = require('../index')
7 var local = 'http://localhost:8888/asdf'
10 request({uri:local, body:{}})
11 assert.fail("Should have throw")
13 assert.equal(e.message, 'Argument error, options.body.')
17 request({uri:local, multipart: 'foo'})
18 assert.fail("Should have throw")
20 assert.equal(e.message, 'Argument error, options.multipart.')
24 request({uri:local, multipart: [{}]})
25 assert.fail("Should have throw")
27 assert.equal(e.message, 'Body attribute missing in multipart.')
31 request(local, {multipart: [{}]})
32 assert.fail("Should have throw")
34 assert.equal(e.message, 'Body attribute missing in multipart.')
37 console.log("All tests passed.")