Skip to content

Commit

Permalink
failing test for recursive requester when using request.METHOD
Browse files Browse the repository at this point in the history
  • Loading branch information
tikotzky committed Feb 15, 2015
1 parent d6c911d commit e2f2338
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/test-defaults.js
Expand Up @@ -213,6 +213,35 @@ tape('recursive defaults', function(t) {
})
})

tape('recursive defaults requester', function(t) {
t.plan(4)

var defaultsOne = request.defaults({}, function(options, callback) {
var headers = options.headers || {}
headers.foo = 'bar1'
options.headers = headers

request(options, callback)
})
, defaultsTwo = defaultsOne.defaults({}, function(options, callback) {
var headers = options.headers || {}
headers.baz = 'bar2'
options.headers = headers

defaultsOne(options, callback)
})

defaultsOne.get(s.url + '/get_recursive1', function (e, r, b) {
t.equal(e, null)
t.equal(b, 'TESTING!')
})

defaultsTwo.get(s.url + '/get_recursive2', function (e, r, b) {
t.equal(e, null)
t.equal(b, 'TESTING!')
})
})

tape('test custom request handler function', function(t) {
t.plan(2)

Expand Down

0 comments on commit e2f2338

Please sign in to comment.