Skip to content

Commit 70011f1

Browse files
committed
Tests: Check if originalScriptCode is available
Fixes codesandbox#742
1 parent 15459a0 commit 70011f1

File tree

2 files changed

+3
-2
lines changed
  • packages/app/src/app/components/Preview/DevTools/Tests

2 files changed

+3
-2
lines changed

packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/ErrorDetails/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ const formatDiffMessage = (error: TestError, path: string) => {
6464
if (
6565
error.mappedErrors &&
6666
error.mappedErrors[0] &&
67-
error.mappedErrors[0].fileName.endsWith(path)
67+
error.mappedErrors[0].fileName.endsWith(path) &&
68+
error.mappedErrors[0]._originalScriptCode
6869
) {
6970
const mappedError = error.mappedErrors[0];
7071

packages/app/src/app/components/Preview/DevTools/Tests/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export type TestError = Error & {
4242
lineNumber: number,
4343
content: string,
4444
highlight: boolean,
45-
}>,
45+
}> | null,
4646
}>,
4747
};
4848

0 commit comments

Comments
 (0)