Skip to content

Commit

Permalink
fix(runner): another way to allow leading space in testNamePattern (v…
Browse files Browse the repository at this point in the history
  • Loading branch information
segrey committed Sep 12, 2023
1 parent e365eb1 commit 547d36b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/runner/src/utils/collect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ export function interpretTaskModes(suite: Suite, namePattern?: string | RegExp,
}
}
if (t.type === 'test') {
if (namePattern && !getTaskFullName(t).match(namePattern))
t.mode = 'skip'
if (namePattern) {
const taskFullName = getTaskFullName(t);
if (taskFullName.match(namePattern) || (' ' + taskFullName).match(namePattern))
t.mode = 'skip'
}
}
else if (t.type === 'suite') {
if (t.mode === 'skip')
Expand Down

0 comments on commit 547d36b

Please sign in to comment.