From 5851dbc300d0139d4836dc4eddb3aba3fff516d2 Mon Sep 17 00:00:00 2001 From: Rafal Galka Date: Fri, 30 Oct 2020 15:56:17 +0100 Subject: [PATCH] fix(e2e): missing app close --- apps/api/test/app.e2e-spec.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/api/test/app.e2e-spec.ts b/apps/api/test/app.e2e-spec.ts index 67991b5..4f800b7 100644 --- a/apps/api/test/app.e2e-spec.ts +++ b/apps/api/test/app.e2e-spec.ts @@ -1,5 +1,5 @@ -import { Test, TestingModule } from '@nestjs/testing'; import { INestApplication } from '@nestjs/common'; +import { Test } from '@nestjs/testing'; import supertest from 'supertest'; import { AppModule } from '../src/app.module'; @@ -7,7 +7,7 @@ describe('AppController (e2e)', () => { let app: INestApplication; beforeEach(async () => { - const moduleFixture: TestingModule = await Test.createTestingModule({ + const moduleFixture = await Test.createTestingModule({ imports: [AppModule], }).compile(); @@ -15,6 +15,10 @@ describe('AppController (e2e)', () => { await app.init(); }); + afterAll(async () => { + await app.close(); + }); + it('/ (GET)', () => { return supertest(app.getHttpServer()) .get('/')