Skip to content

Commit

Permalink
Fix regression where path is resolved incorrectly (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdonaghue authored Feb 9, 2017
1 parent a08125d commit b010d7c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/CoverageTransformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ export default class CoverageTransformer {
rawSourceMap.sources = rawSourceMap.sources.map((srcPath) => {
let tempVal = srcPath;
if (rawSourceMap.sourceRoot) {
tempVal = rawSourceMap.sourceRoot + srcPath;
}
if (tempVal.substr(0, 1) === '.') {
return path.resolve(sourceMapDir, tempVal);
} else {
return tempVal;
tempVal = /\/$/g.test(rawSourceMap.sourceRoot)
? rawSourceMap.sourceRoot + srcPath
: srcPath;
}
return tempVal.substr(0, 1) === '.'
? path.resolve(sourceMapDir, tempVal)
: tempVal
});

let sourceMap = new SourceMapConsumer(rawSourceMap);
Expand Down

0 comments on commit b010d7c

Please sign in to comment.