Failing to load config when doing unit tests with Jest (default config)
See original GitHub issueDescribe the bug A clear and concise description of what the bug is.
Storybooks fails fails to load/find .storybooks
.
To Reproduce Steps to reproduce the behavior:
Create new project with vue-cli
.
Use vue-cli
plugin to add storybook to a fresh Vue project.
Follow instructions in the ‘Getting Started’ guide on setting up ‘Snapshot Testing’ (with Storyshots plugin).
Run:
npm run test:unit
Get:
ENOENT: no such file or directory, lstat '/path/to/project/.storybook'
Expected behavior A clear and concise description of what you expected to happen.
Tests to run.
Screenshots If applicable, add screenshots to help explain your problem.
N/A.
Code snippets If applicable, add code samples to help explain your problem.
N/A.
System:
- OS: Ubuntu 18.10
- Device: Desktop
- Browser: Chrome
- Framework: Vue
- Addons: N/A.
- Version:
"@storybook/addon-actions": "^4.1.0",
"@storybook/addon-knobs": "^4.1.0",
"@storybook/addon-links": "^4.1.0",
"@storybook/addon-notes": "^4.1.0",
"@storybook/addon-storyshots": "^4.1.11",
"vue-cli-plugin-storybook": "^0.5.1",
Additional context Add any other context about the problem here.
N/A.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Configuring Jest
You can retrieve Jest's defaults from jest-config to extend them if needed: ... __tests__/**", "**/*.js"] will not exclude __tests__ because the negation is ......
Read more >Reading in config data throws error in jest unit test
I'm using react in conjunction Jest and enzyme. My unit tests were working as desired until I added a config.json that lives in ......
Read more >Setup - Testing Library
If you're using the Jest testing framework version 24 or lower with the default configuration, it's recommended to use jest-environment-jsdom- ...
Read more >Configuring Jest
By default, Jest runs all tests and produces all errors into the console upon completion. The bail config option can be used here...
Read more >Run/Debug Configuration: Jest | IntelliJ IDEA Documentation
Create: Run | Edit Configurations | Add New Configuration | Jest. In this dialog, create configurations for running Jest tests.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @CrashyBang – sorry I didn’t see your messages above (?)
I think your issue here is you have put your storybook config in a non-standard location (
config/storybook
). Try passing{ configPath: './config/storybook' }
to theinitStoryshots
function.Hey @tmeasday,
Yep that sorted it, I had to use
{ configPath: './testing/config/storybook' }
but now everything works accordingly.Cheers!