I am using ValidationPipe to transform request according to DTOs as follows:
app.useGlobalPipes(
new ValidationPipe({
whitelist: true,
transform: true,
forbidNonWhitelisted: true,
transformOptions: {
enableImplicitConversion: true,
},
}),
);
This seems to work when getting requests from the browser/frontend, but during e2e-tests it fails to transform a query like the following:
startDate = new Date().toISOString();
request(...).get(`.../?startDate=${startDate}`);
request here being from supertest
The DTO is as follows:
@IsNotEmpty()
@IsDate()
readonly startDate: Date;
I am confused since it appears to fail only during e2e-tests? Any help greatly appreciated