@emotion/jest: Unstable order over different systems (docker vs native)
See original GitHub issueCurrent behavior:
The order of interactive styles like :hover
, :focus
etc. is not stable in some cases. They are “jumping” around the “main class”.
If multiple interactive styles exists they also mixing up themselves (e.g in some cases :hover
is before :focus
and in some it comes after).
The problem seems to occur only on docker vs native execution. As i get the same (stable) order on two different macs, running it on two different docker i also get the same (stable) order, but the order differ from the mac ones.
The screenshot shows the diff between running native (origin) and running on docker (the changes) after:
To reproduce:
- Create a component like a button and add some styles including
:hover
,:focus
and:disabled
to it. - Create a
jest
test for usingtoMatchSnapshot
- Run the test native with npm
- Run the test with docker
Expected behavior:
The order of emotion styles should be the same independently from the environment it running on.
Environment information:
react
version: 16.14.0@emotion/jest
version: 11.1.0@testing-library/react
version: 11.2.2
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:10 (5 by maintainers)
Top GitHub Comments
@thisismana could you create a new issue about this? one thing that I would check on your end is if you are creating a cache per SSR request - if not that is the first thing to be fixed.
Ah, I see. I guess this is ok. The mix of emotion and nextjs is sometimes hard to find the “best” solution. Even the nextjs-examples look a bit different in our case. But that’s a different story.
Yes. Thank you very much for your help. ❤️