question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Storyshots afterAll is not defined error

See original GitHub issue

Describe 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:closed
  • Created 4 years ago
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

10reactions
stale[bot]commented, Nov 29, 2019

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!

4reactions
phatedcommented, Feb 4, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found