Skip to content

Commit c1c6d0b

Browse files
authored
call app.close() afterEach in Fastify e2e example
Otherwise you'd get: > Jest did not exit one second after the test run has completed. > This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.
1 parent 4c31b40 commit c1c6d0b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

content/fundamentals/unit-testing.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,10 @@ describe('Cats', () => {
287287
> await app.init();
288288
> await app.getHttpAdapter().getInstance().ready();
289289
> });
290+
>
291+
> afterEach(async () => {
292+
> await app.close();
293+
> });
290294
>
291295
> it(`/GET cats`, () => {
292296
> return app

0 commit comments

Comments
 (0)