I have these files:
File1.js
var mod1 = require('mod1');
mod1.someFunction()
...
File2.js
var File1 = require('./File1');
Now while writing unit tests for File2, is it possible to have mod1 mocked, so that I don't make calls to mod1.someFunction()?
I'm usually using
mockerymodule like following:lib/file1.js
lib/file2.js
lib/mod1.js
test/file1.js
As it was suggested before,
sinonmodule is very convenient to build the mocks.