-
-
Notifications
You must be signed in to change notification settings - Fork 142
Open
Description
Version
2.1.4
Steps to reproduce
- Clone my repo https://github.com/kolesker/ts-jest-styled-display-name-bug
- Choose jest-26 or jest-29 paths to test
- npm install
- npm run test
Expected behavior
In jest 26 you get as snapshot:
"<Component>
<StyledExample>
<div className=\\"test-issue__StyledExample-sc-yycgxi-0 cxgDRm\\" />
</StyledExample>
</Component>"
`;
Actual behavior
In jest 29 you get as snapshot:
"<Component>
<StyledExample>
<div className=\\"sc-beySbM AIKwo\\" />
</StyledExample>
</Component>"
`;
Additional context
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/npmjfriend615, garana-ring, meriouma and jwkellyiii
Metadata
Metadata
Assignees
Labels
No labels