Skip to content

Commit

Permalink
Cypress check was breaking CLUE
Browse files Browse the repository at this point in the history
  • Loading branch information
scytacki committed Oct 2, 2024
1 parent d23f00b commit 3efa5b9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/initialize-app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@ export const initializeApp = (authoring: boolean): IStores => {

// The Cypress docs say you can just check window.Cypress but after a page reload in
// some cases you have to use window.parent.Cypress
const inCypress = aWindow.Cypress || aWindow.parent?.Cypress;
let inCypress = false;
try {
inCypress = aWindow.Cypress || aWindow.parent?.Cypress;
} catch (e) {
// If we are running in a cross origin iframe this will throw an exception
}

if (DEBUG_STORES || inCypress) {
aWindow.stores = stores;
}
Expand Down

0 comments on commit 3efa5b9

Please sign in to comment.