Skip to content

Commit

Permalink
handle missing sourcemap
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Jul 10, 2019
1 parent 2aa68b3 commit 11b1277
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/jest-runtime/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,10 @@ class Runtime {

let sourcemapContent: FixedRawSourceMap | undefined = undefined;

if (istanbulStuff.sourceMapPath) {
if (
istanbulStuff.sourceMapPath &&
fs.existsSync(istanbulStuff.sourceMapPath)
) {
sourcemapContent = JSON.parse(
fs.readFileSync(istanbulStuff.sourceMapPath, 'utf8'),
);
Expand Down

0 comments on commit 11b1277

Please sign in to comment.