Files
bigcapital/packages/server-nest/test/init-app-test.ts
2024-12-31 14:57:24 +02:00

23 lines
510 B
TypeScript

import { INestApplication, Logger } from '@nestjs/common';
import { Test, TestingModule } from '@nestjs/testing';
import { AppModule } from '../src/modules/App/App.module';
let app: INestApplication;
beforeAll(async () => {
const moduleFixture: TestingModule = await Test.createTestingModule({
imports: [AppModule],
}).compile();
app = moduleFixture.createNestApplication();
app.useLogger(new Logger());
await app.init();
});
afterAll(async () => {
await app.close();
});
export { app };