Skip to content

Commit b4be5c5

Browse files
committed
fix tests for node 0.10.x
1 parent 54bf849 commit b4be5c5

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

test/integration/test-submit-url-parsing.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
var http = require('http');
2+
var https = require('https');
13
var common = require('../common');
24
var assert = common.assert;
35
var FormData = require(common.dir.lib + '/form_data');
@@ -13,13 +15,13 @@ form.append('field', 'value');
1315
// Basic parsing
1416
req = form.submit('http://localhost:' + common.port + '/path', function() {});
1517
assert.strictEqual(req.path, '/path');
16-
assert.strictEqual(req.agent.protocol, 'http:');
18+
assert.ok(req.agent instanceof http.Agent, 'req.agent instanceof http.Agent');
1719
assert.strictEqual(req.getHeader('Host'), 'localhost:' + common.port);
1820
req.abort();
1921

2022
// HTTPS protocol handling
2123
req = form.submit('https://localhost:' + common.port + '/path', function() {});
22-
assert.strictEqual(req.agent.protocol, 'https:');
24+
assert.ok(req.agent instanceof https.Agent, 'req.agent instanceof https.Agent');
2325
req.abort();
2426

2527

0 commit comments

Comments
 (0)