diff --git a/packages/vitest/src/node/core.ts b/packages/vitest/src/node/core.ts index ba852b4fa..47950953b 100644 --- a/packages/vitest/src/node/core.ts +++ b/packages/vitest/src/node/core.ts @@ -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) }