Skip to content

Commit 19638b4

Browse files
Merge pull request #2112 from DanielKucal/patch-1
docs(unit-testing): call app.close() afterEach in Fastify e2e test example
2 parents b95f8db + d17fd79 commit 19638b4

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
@@ -299,6 +299,10 @@ describe('Cats', () => {
299299
> expect(result.payload).toEqual(/* expectedPayload */);
300300
> });
301301
> });
302+
>
303+
> afterAll(async () => {
304+
> await app.close();
305+
> });
302306
> ```
303307
304308
In this example, we build on some of the concepts described earlier. In addition to the `compile()` method we used earlier, we now use the `createNestApplication()` method to instantiate a full Nest runtime environment. We save a reference to the running app in our `app` variable so we can use it to simulate HTTP requests.

0 commit comments

Comments
 (0)