Skip to content

Commit

Permalink
fix: insert validation for this.configOverride.project
Browse files Browse the repository at this point in the history
  • Loading branch information
DevJoaoLopes committed Jan 8, 2025
1 parent 15addc2 commit a8a0903
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/vitest/src/node/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -830,12 +830,13 @@ export class Vitest {
files = files.filter(file => filteredFiles.some(f => f.moduleId === file))
}

const specifications = files.flatMap(file => this.getModuleSpecifications(file)).filter(spec => spec.project.name === this.configOverride.project)
const specifications = files.flatMap(file => this.getModuleSpecifications(file))
const specificationsWithFilterByProject = this.configOverride.project ? specifications.filter(spec => spec.project.name === this.configOverride.project) : specifications
await Promise.all([
this.report('onWatcherRerun', files, trigger),
...this._onUserTestsRerun.map(fn => fn(specifications)),
...this._onUserTestsRerun.map(fn => fn(specificationsWithFilterByProject)),
])
const testResult = await this.runFiles(specifications, allTestsRun)
const testResult = await this.runFiles(specificationsWithFilterByProject, allTestsRun)

await this.report('onWatcherStart', this.state.getFiles(files))
return testResult
Expand Down

0 comments on commit a8a0903

Please sign in to comment.