Files
node/test/parallel/test-http-agent-null.js
James M Snell c88f99f1f3 test: improvements to various http tests
* Add common/countdown utility
* Numerous improvements to http tests

PR-URL: https://github.com/nodejs/node/pull/14315
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2017-09-19 14:26:57 -04:00

17 lines
369 B
JavaScript

'use strict';
const common = require('../common');
const http = require('http');
const server = http.createServer(common.mustCall((req, res) => {
res.end();
})).listen(0, common.mustCall(() => {
const options = {
agent: null,
port: server.address().port
};
http.get(options, common.mustCall((res) => {
res.resume();
server.close();
}));
}));