Closed xxluke closed 5 years ago
You have created 2 different fake requests here, hence, you have 2 different instances. I'll describe how it works asap, ref https://github.com/nestjs/docs.nestjs.com/issues/623
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Bug Report
Current behavior
When you spy on a request-scoped provider in a unit test, it does not spy on the same instance of the provider which is called in the later code.
Input Code
Example repo: https://github.com/xxluke/nestjs-typescript-starter
Expected behavior
Test succeeds.
Environment