feat: add swagger

This commit is contained in:
2026-10-21 15:18:42 +03:00
parent a4b03c2a92
commit e20a5a4b4c
11 changed files with 666 additions and 42 deletions
+5 -1
View File
@@ -17,7 +17,10 @@ export interface TestUser {
token: string;
}
export async function createTestApp(env: Record<string, string> = {}): Promise<{
export async function createTestApp(
env: Record<string, string> = {},
setup: (app: NestFastifyApplication) => void = () => undefined,
): Promise<{
app: INestApplication;
server: any;
}> {
@@ -35,6 +38,7 @@ export async function createTestApp(env: Record<string, string> = {}): Promise<{
process.env = saved;
}
configureApp(app);
setup(app);
await app.listen(0, '127.0.0.1');
return { app, server: app.getHttpServer() };
}