From 384aef8db7e31ae6a256a5c70aeead0ec37a7ee0 Mon Sep 17 00:00:00 2001 From: Whitney Young Date: Thu, 5 Jan 2017 18:29:10 -0800 Subject: [PATCH] Fix use of --all when instrumentation is disabled This allows the use of --all with `babel-transform-istanbul`, for instance. --- lib/instrumenters/noop.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/instrumenters/noop.js b/lib/instrumenters/noop.js index 1f0f09470..8a57b4a20 100644 --- a/lib/instrumenters/noop.js +++ b/lib/instrumenters/noop.js @@ -3,12 +3,12 @@ var readInitialCoverage = require('istanbul-lib-instrument').readInitialCoverage function NOOP () { return { - instrumentSync: function (code) { + instrumentSync: function (code, filename) { var extracted = readInitialCoverage(code) if (extracted) { this.fileCoverage = new FileCoverage(extracted.coverageData) } else { - this.fileCoverage = null + this.fileCoverage = new FileCoverage(filename) } return code },