jest-styled-components uses global.beforeEach rather than global.beforeAll or both?
JeromeGill opened this issue · comments
Jerome Gill commented
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?
Ruslan Gonzalez commented
I believe this should be at the developer's convenience, a beforeAll( ) or via an opt-in option.
Liam Harris commented
Yep. Just got caught out by this too. Any resolution for the bug? Would be a good to have this option to use beforeAll
.