New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@Body transform issue: The metatype
property of the 2nd Arg to ValidationPipe.transform(v, metadata) is undefined
during jest e2e supertest
run.
#13108
Comments
Please provide a minimum reproduction repository. You can start one by running why reproductions are required |
@micalevisk May I request a review? I've updated the minimal reproduction comments and reproduction procedure above, and I've posted sample code as you suggested - it's a minimal scenario test, so there's a lot of source code. |
@micalevisk I think this issue is related to the import/export behavior of Typescript. What do you think? I think it's right, it suddenly started working again 😑. All import/export code is working fine during the overhaul. I've had a hard time with this, you've had a hard time, so you can rest now.😌 |
I've no ideia 🤔 |
I thought it was fixed. It was my mistake. It's hard... |
|
Let's reopen it first. |
I'm sure it's just an import/export issue, possibly caused by barrel files (index.ts) introducing a cyclic import in your code, leading to TS metadata being undefined in a specific context |
Is there an existing issue for this?
Current behavior
1. Typical app runs or standalone E2E
supertest
situations:2-1. Nested request API scenario testing situations:
2-2. ValidationPipe.transform Status:
Minimum reproduction code
Steps to reproduce
npm run test:e2e
, check the result: success2, failure3test/module/auth/feature
test/module/board/feature
request
method insrc/module/auth/feature/sign-in-user.api.ts
for each testundefined
check in the title should be checked in theValidationPipe.transform()
method.Expected behavior
ValidationPipe should have no problem converting DTOs through
@Body
. It's too unreliable.Package
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
Other package
No response
NestJS version
10.3.1
Packages versions
The text was updated successfully, but these errors were encountered: