Skip to content

Commit

Permalink
fix: run related test, even if test doesn't have dependencies (#2043)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Sep 19, 2022
1 parent 0b6b77d commit 9dbe4e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/vitest/src/node/core.ts
Expand Up @@ -235,7 +235,7 @@ export class Vitest {
if (!related.length)
return []

const testDeps = await Promise.all(
const testGraphs = await Promise.all(
tests.map(async (filepath) => {
const deps = await this.getTestDependencies(filepath)
return [filepath, deps] as const
Expand All @@ -244,9 +244,9 @@ export class Vitest {

const runningTests = []

for (const [filepath, deps] of testDeps) {
for (const [filepath, deps] of testGraphs) {
// if deps or the test itself were changed
if (deps.size && related.some(path => path === filepath || deps.has(path)))
if (related.some(path => path === filepath || deps.has(path)))
runningTests.push(filepath)
}

Expand Down

0 comments on commit 9dbe4e4

Please sign in to comment.