This commit is contained in:
parent
d8f23a8913
commit
4fbca69942
|
|
@ -20,7 +20,19 @@ describe('Identity Service E2E Tests', () => {
|
||||||
}).compile();
|
}).compile();
|
||||||
|
|
||||||
app = moduleFixture.createNestApplication();
|
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);
|
prisma = app.get<PrismaService>(PrismaService);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue