From 7392f615fecf7b24315e2d97409ecf24c680537d Mon Sep 17 00:00:00 2001 From: Matt Schile Date: Tue, 7 Nov 2023 12:31:23 -0700 Subject: [PATCH] test: updating path separator for mochaEvents (#28265) --- .circleci/workflows.yml | 1 + packages/app/cypress/e2e/runner/support/mochaEventsUtils.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index f76627d252ee..4b736d3c0602 100644 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -85,6 +85,7 @@ windowsWorkflowFilters: &windows-workflow-filters - equal: [ 'chore/update_webpack_deps_to_latest_webpack4_compat', << pipeline.git.branch >> ] - equal: [ 'lerna-optimize-tasks', << pipeline.git.branch >> ] - equal: [ 'em/shallow-checkout', << pipeline.git.branch >> ] + - equal: [ 'mschile/mochaEvents_win_sep', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> diff --git a/packages/app/cypress/e2e/runner/support/mochaEventsUtils.ts b/packages/app/cypress/e2e/runner/support/mochaEventsUtils.ts index a0182a0ebc30..8c3050927d94 100644 --- a/packages/app/cypress/e2e/runner/support/mochaEventsUtils.ts +++ b/packages/app/cypress/e2e/runner/support/mochaEventsUtils.ts @@ -204,5 +204,8 @@ function sanitizeMochaEvents (args: CypressInCypressMochaEvent[]) { } function getCallerFilename () { - return (new Error()).stack!.split('\n')[1].split('/').slice(-1)[0].split(':')[0] + const line = (new Error()).stack!.split('\n')[1] + const pathSep = line.includes('\\') ? '\\' : '/' + + return line.split(pathSep).slice(-1)[0].split(':')[0] }