From 766e291029d4fbc7031624cc2cb9e0b0aed8f32c Mon Sep 17 00:00:00 2001 From: Akshay Patel Date: Sun, 15 Mar 2015 13:14:09 -0700 Subject: [PATCH 1/2] Add a test for the forever agent --- tests/test-agent.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/test-agent.js diff --git a/tests/test-agent.js b/tests/test-agent.js new file mode 100644 index 000000000..cca03d410 --- /dev/null +++ b/tests/test-agent.js @@ -0,0 +1,35 @@ +'use strict' + +var request = require('../index') + , http = require('http') + , tape = require('tape') + +var s = http.createServer(function(req, res) { + res.statusCode = 200 + res.end('ok') +}) + +tape('setup', function(t) { + s.listen(6767, function() { + t.end() + }) +}) + +tape('should work with forever agent', function(t) { + var r = request.forever({maxSockets: 1}) + + r({ + url: 'http://localhost:6767', + headers: { 'Connection':'Close' } + }, function(err, resp, body) { + t.equal(err, null) + t.equal(body, 'ok') + t.end() + }) +}) + +tape('cleanup', function(t) { + s.close(function() { + t.end() + }) +}) From 4b01584294f4398cd9bfd1fb4de5e3f0c2aa84aa Mon Sep 17 00:00:00 2001 From: Akshay Patel Date: Sun, 22 Mar 2015 22:01:16 -0700 Subject: [PATCH 2/2] Upgrade forever-agent to pull in fix for 0.12 and iojs --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d14517142..1b48d8f84 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "dependencies": { "bl": "~0.9.0", "caseless": "~0.9.0", - "forever-agent": "~0.5.0", + "forever-agent": "~0.6.0", "form-data": "~0.2.0", "json-stringify-safe": "~5.0.0", "mime-types": "~2.0.1",