diff options
Diffstat (limited to 'test')
-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 6dca23547..3a654c393 100644 --- a/test/js/node/http/node-http.test.ts +++ b/test/js/node/http/node-http.test.ts @@ -750,4 +750,20 @@ describe("node:http", () => { } }); }); + + test("test server internal error, issue#4298", done => { + const server = createServer((req, res) => { + throw Error("throw an error here."); + }); + server.listen({ port: 0 }, async (_err, host, port) => { + try { + await fetch(`http://${host}:${port}`).then(res => { + expect(res.status).toBe(500); + done(); + }); + } catch (err) { + done(err); + } + }); + }); }); |