From dd40dc5118741415a7f35626555f58390afd9641 Mon Sep 17 00:00:00 2001 From: Martin Schut Date: Tue, 22 Aug 2017 09:04:08 +0200 Subject: [PATCH] feat: add possibility to filter coverage-maps (#637) --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index 4a989749a..0933fa15f 100755 --- a/index.js +++ b/index.js @@ -407,12 +407,16 @@ function coverageFinder () { } NYC.prototype._getCoverageMapFromAllCoverageFiles = function () { + var _this = this var map = libCoverage.createCoverageMap({}) this.loadReports().forEach(function (report) { map.merge(report) }) map.data = this.sourceMaps.remapCoverage(map.data) + map.filter(function (filename) { + return _this.exclude.shouldInstrument(filename) + }) return map }