Skip to content
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

jest-styled-components uses global.beforeEach rather than global.beforeAll or both? #400

Open
JeromeGill opened this issue Feb 4, 2022 · 2 comments

Comments

@JeromeGill
Copy link

This is probably more a question than an issue...

jest-styled-components uses global.beforeEach to reset stylesheets which means in situations where you don't want to remount a component for every test case for whatever reason, you cannot use beforeAll to load it.

Is there a reason jest-styled-components needs to reset stylesheets in beforeEach? If so, is there a reason not to fire it in beforeAll as well?

@ruslanguns
Copy link

ruslanguns commented Feb 4, 2022

I believe this should be at the developer's convenience, a beforeAll( ) or via an opt-in option.

@d3vl1m3
Copy link

d3vl1m3 commented May 19, 2022

Yep. Just got caught out by this too. Any resolution for the bug? Would be a good to have this option to use beforeAll.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants