Skip to content

Commit

Permalink
fix(e2e): missing app close
Browse files Browse the repository at this point in the history
  • Loading branch information
Hagith committed Oct 30, 2020
1 parent 9d51821 commit 5851dbc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/api/test/app.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
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';

describe('AppController (e2e)', () => {
let app: INestApplication;

beforeEach(async () => {
const moduleFixture: TestingModule = await Test.createTestingModule({
const moduleFixture = await Test.createTestingModule({
imports: [AppModule],
}).compile();

app = moduleFixture.createNestApplication();
await app.init();
});

afterAll(async () => {
await app.close();
});

it('/ (GET)', () => {
return supertest(app.getHttpServer())
.get('/')
Expand Down

0 comments on commit 5851dbc

Please sign in to comment.