Closed CodisRedding closed 8 years ago
+1
@fourq How the app
variable is initialised?
I had the same problem before.
You can only do require("file-requiring-module-i-want-to-mock")
after setting your mock with mock.registerMock('../database', ...)
.
If you app
was initialised before the mocking, nothing will work!
@tangzero thanks for pointing me in the right direction ...
What is it that I'm missing?
test.js
file-requiring-module-i-want-to-mock.js