log4js-node/test/sandbox-coverage.js
2022-06-23 01:00:07 +08:00

16 lines
384 B
JavaScript

const sandbox = require('@log4js-node/sandboxed-module');
sandbox.configure({
sourceTransformers: {
nyc(source) {
if (this.filename.indexOf('node_modules') > -1) {
return source;
}
const nyc = new (require('nyc'))({});
return nyc
.instrumenter()
.instrumentSync(source, this.filename, { registerMap: () => {} });
},
},
});