Skip to content

Commit a07e236

Browse files
committed
fix: ensure that projects without optional chainer support can use @cypress/code-coverage
1 parent 5670f05 commit a07e236

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

support.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,11 @@ const registerHooks = () => {
7171
// because we don't control the cross-origin code, we can safely return
7272
let applicationSourceCoverage
7373
try {
74-
applicationSourceCoverage = win?.__coverage__
74+
if (win) {
75+
applicationSourceCoverage = win.__coverage__
76+
}
7577
} catch {}
78+
7679
if (!applicationSourceCoverage) {
7780
return
7881
}

0 commit comments

Comments
 (0)