From 7a442948b727417f46f40fb22b397cede552da64 Mon Sep 17 00:00:00 2001 From: John Schottler Date: Thu, 15 Jul 2021 22:33:40 -0600 Subject: [PATCH] make work for cypress@7.x confirmed this change makes our 34 svelte component tests work --- lib/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/utils.ts b/lib/utils.ts index c8c47f4..89ef9f5 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -3,7 +3,8 @@ import unfetch from 'unfetch' export function checkMountModeEnabled() { // @ts-ignore - if (Cypress.spec.specType !== 'component') { + const specType = Cypress?.spec?.specType // this will be present for cypress@6.x, but not for cypress@7.x + if (specType != null && specType !== 'component') { throw new Error( `In order to use mount or unmount functions please place the spec in component folder`, )