Skip to content

Commit

Permalink
Use source maps from coverage map
Browse files Browse the repository at this point in the history
Part of istanbuljs-archived-repos/istanbul-lib-instrument#23

Alternative could be
to move it to remap-istanbul instead and implement there a custom source
map resolution strategy
  • Loading branch information
Micha Reiser committed Sep 5, 2016
1 parent 5de589f commit ae65954
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/map-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ MapStore.prototype.transformCoverage = function (coverageMap) {
return fs.readFileSync(pathutils.asAbsolute(filePath, that.baseDir));
};

coverageMap.files().forEach(function (file) {
var coverage = coverageMap.fileCoverageFor(file);
if (coverage.data.inputSourceMap && !that.data[file]) {
that.registerMap(file, coverage.data.inputSourceMap);
}
});

if (Object.keys(this.data).length === 0) {
return {
map: coverageMap,
Expand Down

0 comments on commit ae65954

Please sign in to comment.