Skip to content

Commit

Permalink
Always use installed version of vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperpeulen committed Dec 24, 2024
1 parent 44e789c commit dcd4910
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions code/addons/test/src/postinstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit dcd4910

Please sign in to comment.