You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@domenic a minimal test case would be useful. The problem is that Cover works by hooking into require, and sandboxed-module works by kind of replacing require. However, I can see if we can make them work together.
Here ya go. Should have just included it in the bug report.
// sut.jsvarstubMe=require("stubMe");module.exports=function(){if(true){return5;}return6;};// test.jsvarsandboxedModule=require("sandboxed-module");varsut=sandboxedModule.require("./sut",{requires: {stubMe: {}}});// If i leave this as commented out, `sut` never even shows up in the coverage report.// If I uncomment this, everything in `sut` shows up as uncovered.//require("./sut");sut();
I can definitely see where the two would interact poorly, but making them work together would be a big payoff, even if there's explicit integration (e.g. require("node-cover").useSandboxedModule(require("sandboxed-module"))).
sandboxed-module is very useful for testing, but when my tests include a module via
sandboxedModule.require
, that module never gets code-covered.If I manually include that module via
require
as well, then the module shows up as if no code inside it was ever run.I can work to produce a minimal test case here if that would be helpful.
The text was updated successfully, but these errors were encountered: