In the migration from Jest and ts-jest 26 to 29, all of our snapshots are breaking since displayName attribute of babel-styled-components plugin is being ignored. Actually, the issue was introduced when migrating from 26 to 27, but it wasn't solved in the latest 29 version.
The problem is display names in the classes are being completely ignored, while in runtime (non-test environment) it is working OK. Also the issue is only happening after moving out from v26.
Environment
System:
OS: macOS 13.6.2
CPU: (10) arm64 Apple M1 Pro
Binaries:
Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
npm: 9.8.1 - ~/.nvm/versions/node/v9.8.1/bin/npm
Version
2.1.4
Steps to reproduce
Expected behavior
In jest 26 you get as snapshot:
Actual behavior
In jest 29 you get as snapshot:
Additional context
In the migration from
Jest
andts-jest
26 to 29, all of our snapshots are breaking sincedisplayName
attribute ofbabel-styled-components
plugin is being ignored. Actually, the issue was introduced when migrating from 26 to 27, but it wasn't solved in the latest 29 version.The problem is display names in the classes are being completely ignored, while in runtime (non-test environment) it is working OK. Also the issue is only happening after moving out from v26.
Environment