You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Edwin! Thank you for sharing this great project! I really liked it and learned some new things along.
I setup mongoose and mongodb as bakend.
When testing userRouter.test.ts I initialize the database connection, tests pass.
However when testing userService.test.ts I get an error because the database does not get initialized through the backend.
Why do I need to test the service, it should already work as expected if it connected to the database and passed the router tests?
Am I missing something?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi Edwin! Thank you for sharing this great project! I really liked it and learned some new things along.
I setup
mongoose
andmongodb
as bakend.When testing
userRouter.test.ts
I initialize the database connection, tests pass.However when testing
userService.test.ts
I get an error because the database does not get initialized through the backend.Why do I need to test the service, it should already work as expected if it connected to the database and passed the
router tests
?Am I missing something?
Beta Was this translation helpful? Give feedback.
All reactions