Skip to content

Commit

Permalink
fix: path replace fail when dirname has same ext (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
heycalmdown authored and dylans committed Nov 26, 2018
1 parent f7bb605 commit 485b6f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/CoverageTransformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default class CoverageTransformer {

if (origSourceFilename && path.extname(origSourceFilename) !== '' && rawSourceMap.sources.length === 1) {
origFileName = rawSourceMap.file || rawSourceMap.sources[0];
fileName = filePath.replace(path.extname(origFileName), path.extname(origSourceFilename));
fileName = filePath.replace(new RegExp(path.extname(origFileName) + '$'), path.extname(origSourceFilename));
rawSourceMap.file = fileName;
rawSourceMap.sources = [fileName];
rawSourceMap.sourceRoot = '';
Expand Down

0 comments on commit 485b6f7

Please sign in to comment.