import { Test , TestingModule } from "@nestjs/testing" ; import { INestApplication } from "@nestjs/common" ; import { AppModule } from "../src/app.module" ; describe ( "app (e2e)" , ( ) => { let app ; beforeAll ( async ( ) => { const moduleFixture = await Test . createTestingModule ( { imports : [ AppModule ] } ) . compile ( ) ; app = moduleFixture . createNestApplication ( ) ; await app . init ( ) ; } ) ; afterEach ( ( ) => app . close ( ) ) ; it ( "defined" , ( ) => expect ( app ) . toBeDefined ( ) ) ; } ) ;