diff --git a/cypress/support/e2e.ts b/cypress/support/e2e.ts index 90af4e0604fb4..bf1bd15136c2b 100644 --- a/cypress/support/e2e.ts +++ b/cypress/support/e2e.ts @@ -18,7 +18,8 @@ const E2E_TESTING = Cypress.env('E2E_TESTING') // From: https://github.com/cypress-io/cypress/issues/300#issuecomment-688915086 Cypress.on('window:before:load', (win) => { cy.spy(win.console, 'error') - cy.spy(win.console, 'warn')(win as any)._cypress_posthog_captures = [] + cy.spy(win.console, 'warn') + ;(win as any)._cypress_posthog_captures = [] }) Cypress.on('window:load', (win) => {