Skip to content

Commit

Permalink
http: added new test
Browse files Browse the repository at this point in the history
  • Loading branch information
ShogunPanda committed Jun 23, 2022
1 parent 2e3e148 commit ae668c1
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/parallel/test-http-agent-no-wait.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use strict';

const common = require('../common');
const assert = require('assert');
const http = require('http');

const server = http.createServer(function (req, res) {
res.writeHead(200);
res.end();
});

server.listen(0, common.mustCall(() => {
const req = http.get({ port: server.address().port }, (res) => {
assert.strictEqual(res.statusCode, 200);

res.resume();
server.close();
});

req.end();
}));

// This timer should never go off as the server will close the socket
setTimeout(common.mustNotCall(), 1000).unref();

0 comments on commit ae668c1

Please sign in to comment.