()
| 13 | * (global `/api` prefix). |
| 14 | */ |
| 15 | export async function createTestApp(): Promise<INestApplication> { |
| 16 | process.env.DEMO_LLM = "1"; |
| 17 | const dir = mkdtempSync(join(tmpdir(), "ta-api-")); |
| 18 | const ref = await Test.createTestingModule({ imports: [AppModule] }) |
| 19 | .overrideProvider(STORE_DIR) |
| 20 | .useValue(dir) |
| 21 | .compile(); |
| 22 | const app = ref.createNestApplication(); |
| 23 | app.setGlobalPrefix("api"); |
| 24 | app.useGlobalFilters(new AllExceptionsFilter()); |
| 25 | await app.init(); |
| 26 | return app; |
| 27 | } |
no test coverage detected