From 6473fd47c1998854e5ad89a421f48ea72975bacd Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 6 Apr 2022 21:04:28 +0300 Subject: [PATCH] fix: rerun tests on --changed, if test was changed (#1115) --- packages/vitest/src/node/core.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/vitest/src/node/core.ts b/packages/vitest/src/node/core.ts index ba852b4facb8..47950953b777 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) }