From 1ff59273fff9dad19e812c788d15c4e9a6cc4176 Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Tue, 6 Dec 2022 14:36:58 -0600 Subject: [PATCH] ensure to fail if snapshots become unavailable for cypress in cypress --- packages/frontend-shared/cypress/e2e/e2ePluginSetup.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/frontend-shared/cypress/e2e/e2ePluginSetup.ts b/packages/frontend-shared/cypress/e2e/e2ePluginSetup.ts index fb8cbb5c8057..82d4c1d5ecf9 100644 --- a/packages/frontend-shared/cypress/e2e/e2ePluginSetup.ts +++ b/packages/frontend-shared/cypress/e2e/e2ePluginSetup.ts @@ -43,6 +43,11 @@ chai.use(chaiSubset) chai.use(sinonChai) export async function e2ePluginSetup (on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions) { + // @ts-ignore snapshotAuxiliaryData is injected by the snapshot script + if (typeof global.snapshotAuxiliaryData === 'undefined') { + throw new Error('snapshotAuxiliaryData is undefined. v8 snapshots are not being used in Cypress in Cypress') + } + process.env.CYPRESS_INTERNAL_E2E_TESTING_SELF = 'true' delete process.env.CYPRESS_INTERNAL_GRAPHQL_PORT delete process.env.CYPRESS_INTERNAL_VITE_DEV