From 125b41e3250a5a1036dc0ec5e7961bd81af08104 Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Tue, 17 Dec 2024 16:05:56 -0500 Subject: [PATCH] revert changes to getInvocationDetails to see if that breaks tests --- packages/driver/src/cypress/error_utils.ts | 2 +- packages/driver/src/cypress/stack_utils.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/driver/src/cypress/error_utils.ts b/packages/driver/src/cypress/error_utils.ts index 912907703d7d..d9265a6f5411 100644 --- a/packages/driver/src/cypress/error_utils.ts +++ b/packages/driver/src/cypress/error_utils.ts @@ -18,7 +18,7 @@ if (!Error.captureStackTrace) { Error.captureStackTrace = (err, fn) => { const stack = (new Error()).stack - ;(err as Error).stack = $stackUtils.stackWithLinesDroppedFromMarker(stack, fn?.name, false) + ;(err as Error).stack = $stackUtils.stackWithLinesDroppedFromMarker(stack, fn?.name) } } diff --git a/packages/driver/src/cypress/stack_utils.ts b/packages/driver/src/cypress/stack_utils.ts index 45bdc56f96e4..1921088d040c 100644 --- a/packages/driver/src/cypress/stack_utils.ts +++ b/packages/driver/src/cypress/stack_utils.ts @@ -119,8 +119,8 @@ const getInvocationDetails = (specWindow, config) => { // firefox throws a different stack than chromium // which includes stackframes from cypress_runner.js. // So we drop the lines until we get to the spec stackframe (includes __cypress/tests) - if (specWindow.Cypress) { - stack = stackWithLinesDroppedFromMarker(stack, '/__cypress', !specWindow.Cypress.isBrowser('webkit')) + if (specWindow.Cypress && specWindow.Cypress.isBrowser('firefox')) { + stack = stackWithLinesDroppedFromMarker(stack, '__cypress/tests', true) } const details: InvocationDetails = getSourceDetailsForFirstLine(stack, config('projectRoot')) || {};