How to use the hookRequire function from istanbul
Find comprehensive JavaScript istanbul.hookRequire code examples handpicked from public code repositorys.
GitHub: Coobaha/isparta

100 101 102 103 104 105 106 107 108
var coverageVar = "$$cov_" + Date.now() + "$$"; var instrumenter = new Instrumenter({ coverageVariable: coverageVar }); var transformer = instrumenter.instrumentSync.bind(instrumenter); hook.hookRequire(matchFn, transformer, { verbose: opts.verbose }); //initialize the global variable to stop mocha from complaining about leaks global[coverageVar] = {};
istanbul.Collector is the most popular function in istanbul (108 examples)