import { INestApplication } from '@nestjs/common'; import * as request from 'supertest'; import { createTestApp } from './test-utils'; describe('AppController (e2e)', () => { let app: INestApplication; beforeAll(async () => { app = await createTestApp(); }); afterAll(async () => { await app.close(); }); describe('GET /api', () => { it('should return "Hello World!"', () => { return request(app.getHttpServer()) .get('/api') .expect(200) .expect('Hello World!'); }); }); });