Skip to content

Commit fa89bdf

Browse files
committed
fix: align glob behavior for forceRerunTriggers
1 parent 2e5c108 commit fa89bdf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/vitest/src/node/specifications.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import type { Vitest } from './core'
22
import type { TestProject } from './project'
33
import type { TestSpecification } from './spec'
44
import { existsSync } from 'node:fs'
5-
import mm from 'micromatch'
65
import { join, relative, resolve } from 'pathe'
6+
import pm from 'picomatch'
77
import { isWindows } from '../utils/env'
88
import { groupFilters, parseFilter } from './cli/filter'
99
import { GitNotFoundError, IncludeTaskLocationDisabledError, LocationFilterFileNotFoundError } from './errors'
@@ -139,7 +139,8 @@ export class VitestSpecifications {
139139
}
140140

141141
const forceRerunTriggers = this.vitest.config.forceRerunTriggers
142-
if (forceRerunTriggers.length && mm(related, forceRerunTriggers).length) {
142+
const matcher = forceRerunTriggers.length ? pm(forceRerunTriggers) : undefined
143+
if (matcher && related.some(file => matcher(file))) {
143144
return specs
144145
}
145146

0 commit comments

Comments
 (0)