I am having a mocha test suite with two mocha files. They go about doing different things. One of them uses proxyquireify to mock out the http module (and thus get rid of the external calls from the tests). whenever i change
var routeModule = require("../scripts/ui/mapRoute.js");
to
var routeModule = proxyquire("../scripts/ui/mapRoute.js", stubs);
ALL of my source modules get loaded/evaluated twice - which is of course undesired.
Is it plausible wrt design? Is it a surprise? Shall i supply evidence? (evidence is hard to supply in my case, so i don't want to waste time if this is a known issue).
This is expected behavior. Proxyquireify manipulates the cache. Depending on how and where you require your files you can get things that are re-evaluated.
I am having a mocha test suite with two mocha files. They go about doing different things. One of them uses proxyquireify to mock out the http module (and thus get rid of the external calls from the tests). whenever i change var routeModule = require("../scripts/ui/mapRoute.js"); to var routeModule = proxyquire("../scripts/ui/mapRoute.js", stubs);
ALL of my source modules get loaded/evaluated twice - which is of course undesired. Is it plausible wrt design? Is it a surprise? Shall i supply evidence? (evidence is hard to supply in my case, so i don't want to waste time if this is a known issue).