Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addon Test: Fix generated path to vitest.setup.js #30233

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: setupFiles path should use posix-style forward slashes for cross-platform compatibility

},
},
]);
Expand Down
Loading