MCPcopy
hub / github.com/vitest-dev/vitest / rerunFiles

Method rerunFiles

packages/vitest/src/node/core.ts:1197–1216  ·  view source on GitHub ↗

@internal

(files: string[] = this.state.getFilepaths(), trigger?: string, allTestsRun = true, resetTestNamePattern = false)

Source from the content-addressed store, hash-verified

1195
1196 /** @internal */
1197 async rerunFiles(files: string[] = this.state.getFilepaths(), trigger?: string, allTestsRun = true, resetTestNamePattern = false): Promise<TestRunResult> {
1198 if (resetTestNamePattern) {
1199 this.configOverride.testNamePattern = undefined
1200 }
1201
1202 if (this.filenamePattern) {
1203 const filteredFiles = await this.globTestSpecifications(this.filenamePattern)
1204 files = files.filter(file => filteredFiles.some(f => f.moduleId === file))
1205 }
1206
1207 const specifications = files.flatMap(file => this.getModuleSpecifications(file))
1208 await Promise.all([
1209 this.report('onWatcherRerun', files, trigger),
1210 ...this._onUserTestsRerun.map(fn => fn(specifications)),
1211 ])
1212 const testResult = await this.runFiles(specifications, allTestsRun)
1213
1214 await this.report('onWatcherStart', this.state.getFiles(files))
1215 return testResult
1216 }
1217
1218 /** @internal */
1219 async rerunTask(id: string): Promise<void> {

Callers 7

changeNamePatternMethod · 0.95
changeFilenamePatternMethod · 0.95
rerunFailedMethod · 0.95
updateSnapshotMethod · 0.95
rerunFunction · 0.80
_keypressHandlerFunction · 0.80

Calls 9

reportMethod · 0.95
runFilesMethod · 0.95
allMethod · 0.80
filterMethod · 0.65
fnFunction · 0.50
getFilepathsMethod · 0.45
getFilesMethod · 0.45

Tested by

no test coverage detected