wallet-core/node_modules/nyc/lib/instrumenters/noop.js

22 lines
556 B
JavaScript
Raw Normal View History

2017-05-28 00:38:50 +02:00
var FileCoverage = require('istanbul-lib-coverage').classes.FileCoverage
var readInitialCoverage = require('istanbul-lib-instrument').readInitialCoverage
function NOOP () {
return {
instrumentSync: function (code, filename) {
var extracted = readInitialCoverage(code)
if (extracted) {
this.fileCoverage = new FileCoverage(extracted.coverageData)
} else {
this.fileCoverage = null
}
return code
},
lastFileCoverage: function () {
return this.fileCoverage
}
}
}
module.exports = NOOP