forked from mtusi2026/mtusi2026lab2
feat: add swagger
This commit is contained in:
+5
-1
@@ -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() };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user