noop.js 556 B

12345678910111213141516171819202122
  1. var FileCoverage = require('istanbul-lib-coverage').classes.FileCoverage
  2. var readInitialCoverage = require('istanbul-lib-instrument').readInitialCoverage
  3. function NOOP () {
  4. return {
  5. instrumentSync: function (code, filename) {
  6. var extracted = readInitialCoverage(code)
  7. if (extracted) {
  8. this.fileCoverage = new FileCoverage(extracted.coverageData)
  9. } else {
  10. this.fileCoverage = null
  11. }
  12. return code
  13. },
  14. lastFileCoverage: function () {
  15. return this.fileCoverage
  16. }
  17. }
  18. }
  19. module.exports = NOOP