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
The request is not very clear. You are not doing anything except mocking the dependency of a SUT, and what it is - class, function, or a variable - does not matter at all.
I've been wrestling with this example and have created an article outlining what I did to get it to work.
That article is available here: https://coding-art.blogspot.com/2021/03/how-to-test-nodejs-module-and-swap-out.html
I've seen many people ask for this example and I don't know of any that have received a satisfying answer.
I think that if you add this to your tests, we will be satisfied.
Thanks a lot!
(We use the pattern of a module returning a class that is later newed up quite a bit)
The text was updated successfully, but these errors were encountered: