Skip to content

Commit

Permalink
Merge pull request #30134 from storybookjs/kasper/use-installed-versi…
Browse files Browse the repository at this point in the history
…on-vitest

Addon Test: Always use installed version of vitest
  • Loading branch information
yannbf authored Dec 24, 2024
2 parents 44e789c + dcd4910 commit a36f3f0
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 a36f3f0

Please sign in to comment.