chore(test): nest the close({ timeoutMs }) case inside its describe block
CI / dco (push) Has been skipped
CI / dco (pull_request) Successful in 4s
CI / build (push) Successful in 35s
CI / build (pull_request) Successful in 34s

The test landed one line below the closing brace of describe('graceful
shutdown'), so it ran at the top level instead of under the block it
belongs to. Placement only; the assertions are untouched.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
chrnx committed 2026-08-12 13:34:07 -05:00
1 parent 3dcf784159
commit 9d95260706
1 file changed
+17 -17
+17 -17
View File
@@ -464,27 +464,27 @@ describe('graceful shutdown', () => {
await expect(fetch(`http://127.0.0.1:${port}/ticks`).then((r) => r.text())).rejects.toThrow(); await expect(fetch(`http://127.0.0.1:${port}/ticks`).then((r) => r.text())).rejects.toThrow();
reader.cancel().catch(() => {}); reader.cancel().catch(() => {});
}); });
});
it('close({ timeoutMs }) forces shutdown when a handler never responds', async () => { it('close({ timeoutMs }) forces shutdown when a handler never responds', async () => {
@Route('/') @Route('/')
class Ctl { class Ctl {
@Get('/hang') hang() { @Get('/hang') hang() {
return new Promise(() => {}); // never resolves — simulates a stuck handler return new Promise(() => {}); // never resolves — simulates a stuck handler
}
} }
} @Module({ mountpoint: '/', controllers: [Ctl] })
@Module({ mountpoint: '/', controllers: [Ctl] }) class M {}
class M {} const app = createApp({ modules: [M] });
const app = createApp({ modules: [M] }); const server = await app.listen(0);
const server = await app.listen(0); const port = (server.address() as any).port;
const port = (server.address() as any).port;
fetch(`http://127.0.0.1:${port}/hang`).catch(() => {}); fetch(`http://127.0.0.1:${port}/hang`).catch(() => {});
await new Promise((r) => setTimeout(r, 50)); await new Promise((r) => setTimeout(r, 50));
const start = Date.now(); const start = Date.now();
await app.close({ timeoutMs: 300 }); await app.close({ timeoutMs: 300 });
expect(Date.now() - start).toBeLessThan(600); expect(Date.now() - start).toBeLessThan(600);
});
}); });
describe('overrides', () => { describe('overrides', () => {