Skip to content

Commit 3c30585

Browse files
authored
fix(runner): restore leading space in testNamePattern (#4103) (#4104)
1 parent 91853bb commit 3c30585

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

packages/runner/src/utils/collect.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ export function interpretTaskModes(suite: Suite, namePattern?: string | RegExp,
4646
}
4747

4848
function getTaskFullName(task: TaskBase): string {
49-
const fullName = task.suite ? getTaskFullName(task.suite) : null
50-
return fullName ? `${fullName} ${task.name}` : task.name
49+
return `${task.suite ? `${getTaskFullName(task.suite)} ` : ''}${task.name}`
5150
}
5251

5352
export function someTasksAreOnly(suite: Suite): boolean {

test/filters/test/testname-pattern.test.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,3 @@ test('match by pattern that also matches current working directory', async () =>
3030
expect(stdout).toMatch('Test Files 1 passed (1)')
3131
expect(stdout).not.toMatch('test/example.test.ts')
3232
})
33-
34-
test('match by test name pattern with ^', async () => {
35-
const { stdout } = await runVitest({
36-
root: './fixtures',
37-
testNamePattern: '^this',
38-
}, ['filters'])
39-
40-
expect(stdout).toMatch('✓ test/filters.test.ts > this will pass')
41-
expect(stdout).toMatch('Test Files 1 passed (1)')
42-
expect(stdout).not.toMatch('test/example.test.ts')
43-
})

0 commit comments

Comments
 (0)