Skip to content

Commit

Permalink
Merge pull request #30233 from storybookjs/jeppe/fix-vitest-setup-path
Browse files Browse the repository at this point in the history
Addon Test: Fix generated path to `vitest.setup.js`
  • Loading branch information
JReinhold authored Jan 13, 2025
2 parents 2759c5b + f3139a9 commit 1664776
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion code/addons/test/src/postinstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,8 @@ export default async function postInstall(options: PostinstallOptions) {
// If there's an existing config, we create a workspace file so we can run Storybook tests alongside.
const extension = extname(rootConfig);
const browserWorkspaceFile = resolve(dirname(rootConfig), `vitest.workspace${extension}`);
// to be set in vitest config
const vitestSetupFilePath = relative(dirname(browserWorkspaceFile), vitestSetupFile);

logger.line(1);
logger.plain(`${step} Creating a Vitest project workspace file:`);
Expand Down Expand Up @@ -442,7 +444,7 @@ export default async function postInstall(options: PostinstallOptions) {
name: 'chromium',
provider: 'playwright',
},
setupFiles: ['./.storybook/vitest.setup.ts'],
setupFiles: ['${vitestSetupFilePath}'],
},
},
]);
Expand Down

0 comments on commit 1664776

Please sign in to comment.