Storyshots afterAll is not defined error
See original GitHub issueDescribe the bug
ReferenceError: afterAll is not defined
at Object.<anonymous> (/Users/himanshu/Desktop/headout/aer/node_modules/jest-specific-snapshot/dist/index.js:28:1)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/himanshu/Desktop/headout/aer/node_modules/@storybook/addon-storyshots/dist/test-bodies.js:9:1)
To Reproduce Boilerplate of code.
https://github.com/himanshu-dixit/storybook-mock-setup
Expected behavior Should run the test
Screenshots If applicable, add screenshots to help explain your problem.
Code snippets If applicable, add code samples to help explain your problem.
System:
Please paste the results of npx -p @storybook/cli@next sb info
here.
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (3 by maintainers)
Top Results From Across the Web
Typescript with Jest - "ReferenceError: beforeAll is not defined"
ts I get an error for the first Jest related function I have, whether it is beforeAll(), afterAll(), describe()... My tsconfig.json is: {...
Read more >Storybook, React, TypeScript and Jest | by Michael Tiller
N.B. — BTW if, while trying to get these tools working together, you run into an error that says: ReferenceError: React is not...
Read more >LeanFT JavaScript Test Fails: beforeAll is not defined
My LeanFT JavaScript test is failing with the error: beforeAll(function(done) { ^. ReferenceError: beforeAll is not defined. I'm not sure how to fix...
Read more >36. Implement beforeAll and afterAll lifecycle methods in main ...
In this video we will see how to implement beforeAll and afterAll lifecycle methods in the main js spec file - Jasmine TestingUnit...
Read more >How Not to Be Wrong Summary and Review | Jodan Ellenberg
The book overview suggests that if math is at the heart of everything we do and math lives by a set of fixed...
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
Hey there, it’s me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!
I just ran into this and it took me a little bit to figure it out. Essentially, you can’t add
@storybook/addon-storyshots
to your list of addons in.storybook/main.js
because it doesn’t have Jest globals available. Instead, you just create the test files and then run Jest and it generates the storyshot files.I’m not exactly sure why this is called an “addon” if it can’t be added to that addon list.