From dcd49108c917daa707b519a2ff5a95f71fd36d1b Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Tue, 24 Dec 2024 11:14:43 +0100 Subject: [PATCH] Always use installed version of vitest --- code/addons/test/src/postinstall.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/addons/test/src/postinstall.ts b/code/addons/test/src/postinstall.ts index ac91f8aff5c..6418f30fe5e 100644 --- a/code/addons/test/src/postinstall.ts +++ b/code/addons/test/src/postinstall.ts @@ -56,8 +56,7 @@ export default async function postInstall(options: PostinstallOptions) { const allDeps = await packageManager.getAllDependencies(); // only install these dependencies if they are not already installed const dependencies = ['vitest', '@vitest/browser', 'playwright'].filter((p) => !allDeps[p]); - const vitestVersionSpecifier = - allDeps.vitest || (await packageManager.getInstalledVersion('vitest')); + const vitestVersionSpecifier = await packageManager.getInstalledVersion('vitest'); const coercedVitestVersion = vitestVersionSpecifier ? coerce(vitestVersionSpecifier) : null; // if Vitest is installed, we use the same version to keep consistency across Vitest packages const vitestVersionToInstall = vitestVersionSpecifier ?? 'latest';