Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7eb93bb commit eef0b66Copy full SHA for eef0b66
README.md
@@ -39,11 +39,13 @@ rewire("./myModuleA.js") === require("./myModuleA.js"); // = true
39
// Mocks
40
////////////////////////////////
41
var mockedModuleB = {},
42
+ mockedFs = {},
43
mocks = {
44
+ "fs": mockedFs,
45
"path/to/moduleB.js": mockedModuleB
46
};
47
-// The rewired module will now use your mock instead of moduleB.js.
48
+// The rewired module will now use your mocks instead of fs and moduleB.js.
49
// Just make sure that the path is exactly as in myModuleA.js required.
50
rewiredModule = rewire("./myModuleA.js", mocks);
51
0 commit comments