I'm working in a nestjs project that is organized into separate modules. Each module has it's own e2e test. Inside each of these tests an instance of the application is created in the beforeAll() method. Like this
const moduleFixture: TestingModule = await Test.createTestingModule({
imports: [
AppModule,
],
}).compile();
app = moduleFixture.createNestApplication();
await app.init();
At the end of the test the app.close() is called tearing down the app.
Is there a way I can use the same app for all of my tests and then just shut the app down at the end? Creating and tearing down the entire app for each test makes the e2e tests take a long time. Also I'm running into Async timeout errors.