Skip to content

Commit

Permalink
Jest serializer new api (emotion-js#1901)
Browse files Browse the repository at this point in the history
* Remove redundant isTransformed checks

* Move cache.add closer to printer call

* Drop separate test/print exports from @emotion/jest

* Refactor serializers to use new plugin API

* Use stylis to parse & prettify css in @emotion/jest

* Add @emotion/css-prettifier package

* One CSS parser to rule them all

* Allow to customize indentation in @emotion/css-prettifier

* Fix flow errors

* Remove print & test from TS @emotion/jest tests

* Add changesets

* Tweak changeset

* Update .changeset/breezy-carpets-smile.md

Co-authored-by: Mitchell Hamilton <mitchell@hamil.town>

* Remove @emotion/stylis references

Co-authored-by: Mitchell Hamilton <mitchell@hamil.town>
  • Loading branch information
Andarist and emmatown authored Jun 22, 2020
1 parent c5133e7 commit 25c6e29
Show file tree
Hide file tree
Showing 40 changed files with 2,260 additions and 3,663 deletions.
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. This means that `@emotion/jest`(previously `jest-emotion`) can't be used directly in the `snapshotSerializers` option, you should use `@emotion/jest/serializer` instead for this.
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

0 comments on commit 25c6e29

Please sign in to comment.