NestJS · Senior · Question 69 of 75
What does useMocker() on a testing module builder help with?
- ✓Correct answer: It creates mocks automatically for any dependency not explicitly provided, so large dependency graphs don't need manual stubs
- 2It mocks the HTTP server
- 3It replaces Jest
Explanation
Combine it with a mocking library factory (e.g. jest-mock-extended or @golevelup/ts-jest) and override only what the test cares about.