Skip to content

Commit

Permalink
use dynamic path for vitest.setup.js
Browse files Browse the repository at this point in the history
  • Loading branch information
JReinhold committed Jan 10, 2025
1 parent e3b6c66 commit f3139a9
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 @@ -409,6 +409,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 @@ -444,7 +446,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 f3139a9

Please sign in to comment.