I am having some problems with the test generated by default by nest js. I make sure my services are not circularly declared and are both fully exported service and imported module. I have tried other similar stack questions but it doesn't seem to be my case. Please tell me how to fix it. Thanks
CodePudding user response:
- change
auth.controller.spec.ts
to
- change
auth.service.spec.ts
to
- change
users.controller.spec.ts
to
- change
users.service.spec.ts
to
All your errors will be gone
CodePudding user response:
UsersService
has a UserRepository
injection. So if you want to test your controller or service that imports(or uses) UsersService
, you must inject it or use repository mocking.