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 serializer new api #1850

Merged
merged 14 commits into from
May 21, 2020
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/breezy-carpets-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/jest': major
---

`test` & `print` are no longer exported as named exports. If you want to access the default serializer just access the default export.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test & print were exported so you could add @emotion/jest to snapshotSerializers, I think I'd like to keep @emotion/jest working and throw an error when @emotion/jest/serializer is imported that tells people to use @emotion/jest

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, isn't it packing too much into a single module? Having a separate entry point for this seems conceptually easier as with test & print being exported we kinda trick Jest to think that it's a serializer - structurally ok-ish but nominally not so much.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, okay, sure. Let's use the seperate module. Could you make the changeset clearer that using the raw package name in the snapshotSerializers option will no longer work and they'll have to use @emotion/jest/serializer instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added this info, could you re-check?

5 changes: 5 additions & 0 deletions .changeset/famous-bats-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/jest': minor
---

Improved printing of nested at-rules.
5 changes: 5 additions & 0 deletions .changeset/nervous-nails-develop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/jest': major
---

Refactored to use new serializers API which has been introduced in Jest 21.
5 changes: 5 additions & 0 deletions .changeset/odd-poems-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/jest': minor
---

Fixed an issue with all styles being recognized as changed in Jest 25 on unrelated changed.
3 changes: 2 additions & 1 deletion .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"@emotion/eslint-plugin": "10.0.14",
"@emotion/jest": "11.0.0-next.7",
"@emotion/react": "11.0.0-next.7",
"@emotion/server": "11.0.0-next.0"
"@emotion/server": "11.0.0-next.0",
"@emotion/css-prettifier": "1.0.0-next.0"
},
"changesets": [
"angry-cheetahs-march",
Expand Down
Loading