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

[Bug]: Vitest/Test Addon doesn't work if space in path #29572

Open
Tracked by #29531
mindingdata opened this issue Nov 8, 2024 · 2 comments
Open
Tracked by #29531

[Bug]: Vitest/Test Addon doesn't work if space in path #29572

mindingdata opened this issue Nov 8, 2024 · 2 comments

Comments

@mindingdata
Copy link

Describe the bug

If your project is in a folder that has a space in it, Vitest cannot find your tests. This may be a bug with Vitest but since it gives a specific error for Storybook I'll log it here. This could be windows only, unsure.

Create any Storybook project, with the test addon as described here : https://storybook.js.org/docs/writing-tests/test-addon
Ensure that the path is something like c:\my projects\storybook\src with a space somewhere in the path

When I execute npm run test, I get the following error for all stories. Note that I do not have any specific spec/test files, at this stage I'm just using it as a smoke test.

Error: No test suite found in file C:/my projects/storybook/src/stories/global/popover/popover.stories.tsx

If I remove the space in "my projects" the tests all run fine.

I'm not sure if this should be added to the docs because it is "true" that I do not have specific test suite files in those files (They are simply stories), so I thought maybe I had to write specific spec files etc.

Reproduction link

http://no.com

Reproduction steps

No response

System

Storybook Environment Info:

System:
OS: Windows 10 10.0.19045
CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-1245U
Binaries:
Node: 20.10.0 - C:\Node\node-v20.10.0-win-x64\node.EXE
npm: 10.2.3 - C:\Node\node-v20.10.0-win-x64\npm.CMD <----- active
Browsers:
Edge: Chromium (128.0.2739.42)
npmPackages:
@storybook/addon-a11y: ^8.4.2 => 8.4.2
@storybook/addon-essentials: ^8.4.2 => 8.4.2
@storybook/addon-links: ^8.4.2 => 8.4.2
@storybook/blocks: ^8.4.2 => 8.4.2
@storybook/experimental-addon-test: ^8.4.2 => 8.4.2
@storybook/react: ^8.4.2 => 8.4.2
@storybook/react-vite: ^8.4.2 => 8.4.2
@storybook/test: ^8.4.2 => 8.4.2
@storybook/test-runner: ^0.19.1 => 0.19.1
eslint-plugin-storybook: ^0.11.0 => 0.11.0
storybook: ^8.4.2 => 8.4.2

Additional context

No response

@valentinpalkovic
Copy link
Contributor

Hi @mindingdata

Thank you for reporting the bug. Can you also reproduce this on a non-windows machine, or is this Windows-related?

@mindingdata
Copy link
Author

Good question. Don't have a non-windows machine unfortunately :\

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants