NestJS · Middle · Question 41 of 75
In an e2e test, why apply the same global pipes and filters as in main.ts?
- 1Pipes don't work in tests
- 2Tests require different pipes
- ✓Correct answer: Settings made in
main.tsaren't part ofAppModule, so the test app doesn't get them unless you add them again or register them withAPP_*providers
Explanation
Registering global pipes and filters as APP_PIPE/APP_FILTER providers inside the module avoids this mismatch.