From 2544da978e8c568efca48637b49aef9cc20d2551 Mon Sep 17 00:00:00 2001 From: KHeo Date: Fri, 12 Nov 2021 11:21:04 +0900 Subject: [PATCH] fix failures. --- packages/driver/src/cy/ensures.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/driver/src/cy/ensures.ts b/packages/driver/src/cy/ensures.ts index 34155369c012..0f7eadbbae1d 100644 --- a/packages/driver/src/cy/ensures.ts +++ b/packages/driver/src/cy/ensures.ts @@ -12,6 +12,8 @@ const VALID_POSITIONS = 'topLeft top topRight left center right bottomLeft botto // they may need to work with both element arrays, or specific items // such as a single element, a single document, or single window +let returnFalse = () => false + export const create = (state, expect) => { // TODO: we should probably normalize all subjects // into an array and loop through each and verify @@ -152,7 +154,9 @@ export const create = (state, expect) => { } const runVisibilityCheck = (subject, onFail, method) => { - const visibleSubjects = subject.filter(() => !method(this, 'isVisible()', { checkOpacity: false })) + const visibleSubjects = subject.filter(function () { + return !method(this, 'isVisible()', { checkOpacity: false }) + }) if (subject.length !== visibleSubjects.length) { const cmd = state('current').get('name') @@ -240,7 +244,7 @@ export const create = (state, expect) => { } const ensureExistence = (subject) => { - const returnFalse = () => { + returnFalse = () => { cleanup() return false