jest-preset-angular file paths need updated
See original GitHub issueDescribe the bug
jest-preset-angular have moved files around in their v9 release. setup-jest should now be imported from jest-preset-angular/setup-jest
instead of jest-preset-angular/build/setup-jest
The import of setup-jest here needs an additional tryCatch block for the new file location/name https://github.com/storybookjs/storybook/blob/next/addons/storyshots/storyshots-core/src/frameworks/angular/loader.ts#L21
This bug prevents storyshots from running with jest v27 and jest-preset-angular v9
To Reproduce jest-preset-angular >9
System Environment Info:
System: OS: macOS 10.15.7 CPU: (16) x64 Intel® Core™ i9-9880H CPU @ 2.30GHz Binaries: Node: 14.17.0 - ~/.nvm/versions/node/v14.17.0/bin/node Yarn: 1.22.10 - ~/.nvm/versions/node/v14.17.0/bin/yarn npm: 6.14.13 - ~/.nvm/versions/node/v14.17.0/bin/npm Browsers: Chrome: 91.0.4472.77 Firefox: 88.0.1 Safari: 14.1.1 npmPackages: @storybook/addon-a11y: 6.2.9 => 6.2.9 @storybook/addon-actions: 6.2.9 => 6.2.9 @storybook/addon-essentials: 6.2.9 => 6.2.9 @storybook/addon-links: 6.2.9 => 6.2.9 @storybook/addon-postcss: 2.0.0 => 2.0.0 @storybook/addon-storyshots: 6.2.9 => 6.2.9 @storybook/addon-storysource: 6.2.9 => 6.2.9 @storybook/angular: 6.2.9 => 6.2.9
Additional context
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top GitHub Comments
Don’t know if someone forked the project but I managed to make things work by using jest config’s moduleNameMapper to override the paths :
I would recommend somebody releases a forked version of storyshots.