then-request
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "then-request", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "A request library that returns promises, inspired by request", | ||
@@ -8,11 +8,11 @@ "keywords": [], | ||
"dependencies": { | ||
"promise": "^6.0.0", | ||
"concat-stream": "^1.4.6", | ||
"qs": "^2.2.3", | ||
"promise": "^6.0.1", | ||
"concat-stream": "^1.4.7", | ||
"qs": "^2.3.3", | ||
"http-response-object": "^1.0.1", | ||
"http-basic": "^1.0.3" | ||
"http-basic": "^1.1.1" | ||
}, | ||
"devDependencies": { | ||
"testit": "^1.2.0", | ||
"istanbul": "^0.3.0" | ||
"istanbul": "^0.3.5" | ||
}, | ||
@@ -19,0 +19,0 @@ "scripts": { |
@@ -5,2 +5,3 @@ 'use strict'; | ||
var test = require('testit'); | ||
var Promise = require('promise'); | ||
@@ -10,2 +11,4 @@ test('./lib/handle-qs.js', function () { | ||
assert(handleQs('http://example.com/', {}) === 'http://example.com/'); | ||
assert(handleQs('http://example.com/?foo=bar', {}) === 'http://example.com/?foo=bar'); | ||
assert(handleQs('http://example.com/', {foo: 'bar'}) === 'http://example.com/?foo=bar'); | ||
@@ -72,4 +75,26 @@ assert(handleQs('http://example.com/', {foo: {bar: 'baz'}}) === 'http://example.com/?foo%5Bbar%5D=baz'); | ||
}); | ||
test(env + ' - Callbacks', function () { | ||
return new Promise(function (resolve, reject) { | ||
return request('GET', 'http://example.com', function (err, res) { | ||
if (err) return reject(err); | ||
assert(res.statusCode === 200); | ||
assert(res.headers['foo'] === 'bar'); | ||
assert(res.body.toString() === 'body'); | ||
resolve(null); | ||
}); | ||
}); | ||
}); | ||
test(env + ' - Callbacks', function () { | ||
return new Promise(function (resolve, reject) { | ||
return request('GET', 'http://example.com', {}, function (err, res) { | ||
if (err) return reject(err); | ||
assert(res.statusCode === 200); | ||
assert(res.headers['foo'] === 'bar'); | ||
assert(res.body.toString() === 'body'); | ||
resolve(null); | ||
}); | ||
}); | ||
}); | ||
} | ||
testEnv('browser'); | ||
testEnv('server'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18400
336
Updatedconcat-stream@^1.4.7
Updatedhttp-basic@^1.1.1
Updatedpromise@^6.0.1
Updatedqs@^2.3.3