mirror of https://github.com/nodejs/node.git
test: try to connect after server was closed
PR-URL: https://github.com/nodejs/node/pull/18257 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>pull/18787/merge
parent
b74a6da5d0
commit
befe675af8
|
@ -27,11 +27,10 @@ const assert = require('assert');
|
|||
const server = net.createServer();
|
||||
server.listen(0);
|
||||
const port = server.address().port;
|
||||
const c = net.createConnection(port);
|
||||
|
||||
c.on('connect', common.mustNotCall());
|
||||
|
||||
c.on('error', common.mustCall((e) => {
|
||||
assert.strictEqual('ECONNREFUSED', e.code);
|
||||
server.close(common.mustCall(() => {
|
||||
const c = net.createConnection(port);
|
||||
c.on('connect', common.mustNotCall());
|
||||
c.on('error', common.mustCall((e) => {
|
||||
assert.strictEqual('ECONNREFUSED', e.code);
|
||||
}));
|
||||
}));
|
||||
server.close();
|
||||
|
|
Loading…
Reference in New Issue