Skip to content

Commit 1664776

Browse files
authored
Merge pull request #30233 from storybookjs/jeppe/fix-vitest-setup-path
Addon Test: Fix generated path to `vitest.setup.js`
2 parents 2759c5b + f3139a9 commit 1664776

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

code/addons/test/src/postinstall.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,8 @@ export default async function postInstall(options: PostinstallOptions) {
407407
// If there's an existing config, we create a workspace file so we can run Storybook tests alongside.
408408
const extension = extname(rootConfig);
409409
const browserWorkspaceFile = resolve(dirname(rootConfig), `vitest.workspace${extension}`);
410+
// to be set in vitest config
411+
const vitestSetupFilePath = relative(dirname(browserWorkspaceFile), vitestSetupFile);
410412

411413
logger.line(1);
412414
logger.plain(`${step} Creating a Vitest project workspace file:`);
@@ -442,7 +444,7 @@ export default async function postInstall(options: PostinstallOptions) {
442444
name: 'chromium',
443445
provider: 'playwright',
444446
},
445-
setupFiles: ['./.storybook/vitest.setup.ts'],
447+
setupFiles: ['${vitestSetupFilePath}'],
446448
},
447449
},
448450
]);

0 commit comments

Comments
 (0)