This commit is contained in:
hailin 2025-11-24 02:12:13 -08:00
parent d8f23a8913
commit 4fbca69942
1 changed files with 13 additions and 1 deletions

View File

@ -20,7 +20,19 @@ describe('Identity Service E2E Tests', () => {
}).compile();
app = moduleFixture.createNestApplication();
app.useGlobalPipes(new ValidationPipe({ transform: true, whitelist: true }));
// 设置全局前缀,与 main.ts 保持一致
app.setGlobalPrefix('api/v1');
// 设置全局验证管道
app.useGlobalPipes(
new ValidationPipe({
whitelist: true,
forbidNonWhitelisted: true,
transform: true,
transformOptions: { enableImplicitConversion: true },
}),
);
prisma = app.get<PrismaService>(PrismaService);