Skip to content

Commit

Permalink
fix: rerun tests on --changed, if test was changed (#1115)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Apr 6, 2022
1 parent 57c048b commit 6473fd4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vitest/src/node/core.ts
Expand Up @@ -202,7 +202,8 @@ export class Vitest {
const runningTests = []

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

Expand Down

0 comments on commit 6473fd4

Please sign in to comment.