Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eef0b66

Browse files
committed
Update master
1 parent 7eb93bb commit eef0b66

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ rewire("./myModuleA.js") === require("./myModuleA.js"); // = true
3939
// Mocks
4040
////////////////////////////////
4141
var mockedModuleB = {},
42+
mockedFs = {},
4243
mocks = {
44+
"fs": mockedFs,
4345
"path/to/moduleB.js": mockedModuleB
4446
};
4547

46-
// 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.
4749
// Just make sure that the path is exactly as in myModuleA.js required.
4850
rewiredModule = rewire("./myModuleA.js", mocks);
4951

0 commit comments

Comments
 (0)