-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Storyshots | missing module spdx-license-ids #3728
Comments
Can you please share your |
Thanks for the reply. jest.config.json:
Bonus: jest.setup.js
|
Can't find anything problematic here. Do you have a public repo with the reproduction? |
Thanks for checking it out. I'll create a public repo and see or I can reproduce the problem. |
Please check this out: https://github.com/stefanKuijers/storybookStoryshot |
Also running into this. Identical error: "jest": {
"transform": {
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"testRegex": "(test-setup/storyshot|/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
"moduleFileExtensions": ["ts", "tsx", "js"],
"coveragePathIgnorePatterns": ["/node_modules/", "/test/"],
"coverageThreshold": {
"global": {
"branches": 90,
"functions": 95,
"lines": 95,
"statements": 95
}
},
"collectCoverage": true
} |
Could it be it is related to typescript? like ts-jest or the @types files... It would have to be the combination though as before I added Storyshots, ts-jest was running fine. Note that in the TS version we cannot run the exact code from the starter guide. In the starter guide they ask to run
|
I'm getting the same thing. Jest config in package.json:
Dependencies:
With setupTests.js looking like this:
And scripts/test.js (adapted from create-react-app):
And finally storyshots.test.js (lives inside
|
thanks @lapanti for showing another case. Your case seems to rule out that the problem is related to TypeScript. If I have time this weekend I'll play around with different versions of storybook, addon-storyshots etc. I'd be happy to check through commit history as well but that seems to be pretty hard at storybook as its all one big repo. Is there a way to only see commits that are about storyshot? That'd be a great help. |
@danielduan Thanks for joining the discussion. I'm not sure why you added the needs reproduction tag. Did you see I already provided a repo, ^some comments above^ that reproduces the problem? @igor-dv : Did you manage to checkout the provided repo? |
Not yet but soon will try (today or tomorrow). |
Path to solving the issueI think I got it solved. @lapanti & @psachs21 please check or this solves it for you as well. Short VersionIssue was fixed by doing the following:
ModuleFileExtensionsMeanwhile I've been experimenting with multiple versions of storyshots. It seems since version 3.4 the above mentioned error was thrown. Before that version (3.2.19) it threw another error: ConfigPathThis seems to be pointing to that package .json can't be read so I added Note that in my project the storybook folder does not have a dot in its name. Path was wrong. I tried fixing this issue before cause I read the docs before I started. But back then when I tried it I did not fix the JSON error yet. Imports
which meant it could not handle that in my config file I used an import statement. Refactored my config file to not use any imports but only requires:
Wrapping upIt would be good to have some more clear error handling concerning that json was missing in moduleFileExtensions. Actually, maybe it needs to be added to storyshot setup in readme. @igor-dv : what do you think? The other errors are clearly on my side but I just added them in case others are struggling with these. I pushed the fix to the repo: |
thanks @stefanKuijers that did it for me as well |
Yeah, mentioning this may help. Wanna PR it? |
I will create a PR for the documentation, sure |
@igor-dv Just wanting to start the PR but I have some questions:
|
Yeah, you can describe the use case and explain that solution is to add a |
I was working on a totally different project and this solved my problem. Thx. |
Bug @ storyshot
I used the getting started guide of StoryShot. I've follow the steps for a react app. When I run my test script it throws the following error:
Steps to reproduce
yarn add --dev @storybook/addon-storyshots react-test-renderer @types/storybook__addon-storyshots
jest --config test/unit/jest.config.json
I had other tests before which ran fine. Just after I added storyshot I ran into this issue.
Versions
@storybook/react ^3.4.2
@storybook/addon-storyshot ^3.4.6
@storybook/addon-jest ^3.4.6
Affected platforms
Would you guys have any idea whats the issue?
The text was updated successfully, but these errors were encountered: