From 073a50c9740f75ba25ec1fabba73b6dae73e66f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ari=20Perkki=C3=B6?= Date: Fri, 26 Jul 2024 10:08:40 +0300 Subject: [PATCH] fix: `testNamePattern` adds leading space (#6186) --- packages/runner/src/collect.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/runner/src/collect.ts b/packages/runner/src/collect.ts index 74c2d1230095..c30a86220c75 100644 --- a/packages/runner/src/collect.ts +++ b/packages/runner/src/collect.ts @@ -77,6 +77,14 @@ export async function collectTests( calculateSuiteHash(file) + file.tasks.forEach((task) => { + // task.suite refers to the internal default suite object + // it should not be reported + if (task.suite?.id === '') { + delete task.suite + } + }) + const hasOnlyTasks = someTasksAreOnly(file) interpretTaskModes( file, @@ -86,13 +94,6 @@ export async function collectTests( config.allowOnly, ) - file.tasks.forEach((task) => { - // task.suite refers to the internal default suite object - // it should not be reported - if (task.suite?.id === '') { - delete task.suite - } - }) files.push(file) }