Skip to content

Commit 48373a9

Browse files
cexbrayatdylans
authored andcommitted
Fix: handle no file attribute on rawSourceMap (#170)
Fixes #168
1 parent 1b240d3 commit 48373a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/CoverageTransformer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export default class CoverageTransformer {
140140
origSourceFilename = rawSourceMap.sources[0];
141141

142142
if (origSourceFilename && path.extname(origSourceFilename) !== '' && rawSourceMap.sources.length === 1) {
143-
origFileName = rawSourceMap.file;
143+
origFileName = rawSourceMap.file || rawSourceMap.sources[0];
144144
fileName = filePath.replace(path.extname(origFileName), path.extname(origSourceFilename));
145145
rawSourceMap.file = fileName;
146146
rawSourceMap.sources = [fileName];

0 commit comments

Comments
 (0)