Skip to content

Commit ccab32a

Browse files
committed
fix: report untested files when running the whole suite
Fixes #361
1 parent 026f945 commit ccab32a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/worker/coverage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class VitestCoverage {
5757
this._config.reportOnFailure = true
5858
this._config.reportsDirectory = join(tmpdir(), `vitest-coverage-${randomUUID()}`)
5959

60-
this.ctx.logger.log('Coverage reports directory is generated:', this._config.reportsDirectory)
60+
this.ctx.logger.log('Running coverage with configuration:', this._config)
6161

6262
if (!this._provider) {
6363
// @ts-expect-error private method

src/worker/vitest.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class Vitest implements VitestMethods {
5858
}
5959
else {
6060
const specs = await this.globTestFiles(files)
61-
await this.runTestFiles(specs.map(([_, spec]) => spec))
61+
await this.runTestFiles(specs.map(([_, spec]) => spec), undefined, !files)
6262
}
6363
}
6464

@@ -82,15 +82,15 @@ export class Vitest implements VitestMethods {
8282
return files
8383
}
8484

85-
private async runTestFiles(files: string[], testNamePattern?: string | undefined) {
85+
private async runTestFiles(files: string[], testNamePattern?: string | undefined, runAllFiles = false) {
8686
await this.ctx.runningPromise
8787
this.watcher.markRerun(false)
8888
process.chdir(this.cwd)
8989

9090
try {
9191
this.setTestNamePattern(testNamePattern)
9292

93-
await this.rerunTests(files)
93+
await this.rerunTests(files, runAllFiles)
9494
}
9595
finally {
9696
process.chdir(cwd)
@@ -101,9 +101,9 @@ export class Vitest implements VitestMethods {
101101
this.ctx.configOverride.testNamePattern = pattern ? new RegExp(pattern) : undefined
102102
}
103103

104-
private async rerunTests(files: string[]) {
104+
private async rerunTests(files: string[], runAllFiles = false) {
105105
await this.ctx.report('onWatcherRerun', files)
106-
await this.ctx.runFiles(files.flatMap(file => this.ctx.getProjectsByTestFile(file)), false)
106+
await this.ctx.runFiles(files.flatMap(file => this.ctx.getProjectsByTestFile(file)), runAllFiles)
107107

108108
await this.ctx.report('onWatcherStart', this.ctx.state.getFiles(files))
109109
}

0 commit comments

Comments
 (0)