#nest-jest error of injeccion while run my test
1 messages Ā· Page 1 of 1 (latest)
that's weird
Full error?
Where does master-dataConnection come from?
Is a provider
Wait
in mi app.module I include my database module
this module contains the two connections I use
then the database module looks like this (image 2):
good, Well, I imported the database module in my test and it worked, is it correct to do this?
It depends
Are you making an unit test of CalculationService?
yess
So I donāt see any good reason to import other modules
Why?
You arenāt exercising that service
You shouldnāt have any error on that. Got it?
My provider is used by the configServices to obtain the environment variables, is that why?
Mock it then
Otherwise youāll end up testing that another service as a side-effect
The post Iāve shared with you has basically everything you need to know in order to get no dependency resolution error on unit tests
good