Skip to content

Commit d866746

Browse files
mjhenkesflotwig
andauthored
Update packages/runner-shared/src/event-manager.js
Co-authored-by: Zach Bloomquist <[email protected]>
1 parent 3e6d6bf commit d866746

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/runner-shared/src/event-manager.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,9 @@ export const eventManager = {
321321

322322
// The window.top should not change between test reloads, and we only need to bind the message event once
323323
// Forward all message events to the current instance of the multi-origin communicator
324-
window.top?.addEventListener('message', ({ data, source }) => {
324+
if (!window.top) throw new Error('missing window.top in event-manager')
325+
326+
window.top.addEventListener('message', ({ data, source }) => {
325327
Cypress.primaryOriginCommunicator.onMessage({ data, source })
326328
}, false)
327329
},

0 commit comments

Comments
 (0)