mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
* 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>
17 lines
369 B
JavaScript
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();
|
|
}));
|
|
}));
|