diff options
Diffstat (limited to 'test/js/node/http/node-http.test.ts')
-rw-r--r-- | test/js/node/http/node-http.test.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/js/node/http/node-http.test.ts b/test/js/node/http/node-http.test.ts index 24c0b40bf..326699665 100644 --- a/test/js/node/http/node-http.test.ts +++ b/test/js/node/http/node-http.test.ts @@ -926,4 +926,20 @@ describe("node:http", () => { } }); }); + + test("error event not fired, issue#4651", done => { + const server = createServer((req, res) => { + res.end(); + }); + server.listen({ port: 42069 }, () => { + const server2 = createServer((_, res) => { + res.end(); + }); + server2.on("error", err => { + expect(err.code).toBe("EADDRINUSE"); + done(); + }); + server2.listen({ port: 42069 }, () => {}); + }); + }); }); |