Skip to content

Commit 8349743

Browse files
committed
perf: compile glob only once
1 parent 018a841 commit 8349743

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/vitest/src/node/coverage.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,9 @@ export class BaseCoverageProvider<Options extends ResolvedCoverageOptions<'istan
316316
const globThresholds = resolveGlobThresholds(this.options.thresholds![glob])
317317
const globCoverageMap = this.createCoverageMap()
318318

319+
const matcher = pm(glob)
319320
const matchingFiles = files.filter(file =>
320-
pm.isMatch(relative(this.ctx.config.root, file), glob),
321+
matcher(relative(this.ctx.config.root, file)),
321322
)
322323

323324
for (const file of matchingFiles) {

0 commit comments

Comments
 (0)