- #2709
1a25293f
Thanks @thompsongl! - AddedincludeStyles
option tocreateSerializer
to optionally disable styles printing.
- #2600
2f27156a
Thanks @Andarist! - Adjusted Enzyme-related code path to accomodate for changes related to the refactor around usingReact.useInsertionEffect
.
-
#2590
1554a7e2
Thanks @Andarist! - Upgraded and pinned the version of Stylis - the CSS parser that Emotion uses under the hood. -
Updated dependencies [
1554a7e2
]:- @emotion/css-prettifier@1.0.1
- #2542
eb013d25
Thanks @eps1lon, @Andarist! - Adjusted the serialization logic to unwrap rendered elements from Fragments that had to be added to fix hydration mismatches caused byReact.useId
usage (the upcoming API of the React 18).
- #2456
500cdd82
Thanks @billyjanitsch! - Support typings for Jest v27
- #2457
218e4f78
Thanks @jcleefw! - AddRegExp
as a valid type for thetarget
option accepted bytoHaveStyleRule
.
4e911edb
#2336 Thanks @iChenLei! - UsedisplayName
when printing shallowly rendered elements with css prop.
66ccd43e
#2269 Thanks @mskelton! - Fixed the Enzyme serializer to work properly with conditional styles passed to thecss
prop.
66ccd43e
#2269 Thanks @mskelton! - Fixed the Enzyme serializer to always print composed styles (for example using arrays), which are passed to thecss
prop, correctly.
0c31ed05
#2233 Thanks @ajs139! - Fixed an issue with Enzyme snapshots for components using an array as thecss
prop - those should be printed OK now.
c470c855
#2109 Thanks @Andarist! -createEnzymeSerializer
export has been removed from the root entrypoint and moved to a dedicated@emotion/jest/enzyme
entrypoint. This is unfortunate because it could be considered a breaking change but it has been decided to treat this as a bug fix. It was never the intention to export this from the root entrypoint -enzyme-to-json
has been marked as an optional peer dependency of@emotion/jest
since the release and it was the package structure that did not match this expectation by mistake.
b8476e08
#1675 Thanks @mitchellhamilton! - Renamejest-emotion
to@emotion/jest
. Please replace"snapshotSerializers": ["jest-emotion"]
with"snapshotSerializers": ["@emotion/jest/serializer"]
if you're using the snapshot serializer. Also replace any imports ofjest-emotion
with@emotion/jest
or use the@emotion/pkg-renaming
ESLint rule from@emotion/eslint-plugin
.
-
ca599c5f
#1901 Thanks @Andarist! -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
(previouslyjest-emotion
) can't be used directly in thesnapshotSerializers
option, you should use@emotion/jest/serializer
instead for this. -
ca599c5f
#1901 Thanks @Andarist! - Refactored to use new serializers API which has been introduced in Jest 21. -
cd77efbf
#1920 Thanks @Andarist! - The root entry (@emotion/jest
) no longer hasdefault
andserializer
exports. You can still importcreateSerializer
from it to create your own serializer if needed.
-
cd77efbf
#1920 Thanks @Andarist! -@emotion/jest/serializer
's main purpose is compatibility with Jest'ssnapshotSerializers
option, so it no longer has a default export - it only hastest
&serialize
exports. You can importcreateSerializer
from the root entry (@emotion/jest
) and create your own serializer if needed. -
702f3fd2
#1620 Thanks @spudly! - Added theT
parameter to theMatchers
interface in the TypeScript definitions to make this module compatible with@types/jest@^24.0.20
.
b8476e08
#1675 Thanks @mitchellhamilton! - Improve support for Enzyme's shallow rendering with the addition of the@emotion/jest/enzyme-serializer
snapshot serializer.
ca599c5f
#1901 Thanks @Andarist! - Fixed an issue with all styles being recognized as changed in Jest 25 on unrelated changes.
8a88e771
#1880 Thanks @Jimmydalecleveland! - Improved stability of the generated snapshots - styles are extracted now based on the order in which the associated with them class names appear in the serialized elements rather than based on the order of the actual rules in the document.
-
ae8c1d9d
#1902 Thanks @Andarist! - Added support for handling regular React elements (objects returned fromReact.createElement
) in the serializer andtoHaveStyleRule
matcher. It's possible to get those elements when traversing Enzyme's trees. -
3abcf673
#2043 Thanks @Andarist! -@types/jest
has been moved from the dependencies to the optional peer dependencies as it should not be installed automatically for users not using TypeScript. -
Updated dependencies []:
- @emotion/css-prettifier@1.0.0
5d094b57
#2027 Thanks @Andarist! - Fixed an issue with serializing Enzyme'sReactWrapper
(what is returned frommount
) with props containing elements without the css prop.
8a88e771
#1880 Thanks @Jimmydalecleveland! - Improved stability of the generated snapshots - styles are extracted now based on the order in which the associated with them class names appear in the serialized elements rather than based on the order of the actual rules in the document.
ae8c1d9d
#1902 Thanks @Andarist! - Added support for handling regular React elements (objects returned fromReact.createElement
) in the serializer andtoHaveStyleRule
matcher. It's possible to get those elements when traversing Enzyme's trees.
cd77efbf
#1920 Thanks @Andarist! - The root entry (@emotion/jest
) no longer hasdefault
andserializer
exports. You can still importcreateSerializer
from it to create your own serializer if needed.
cd77efbf
#1920 Thanks @Andarist! -@emotion/jest/enzyme
entrypoint has been renamed to@emotion/jest/enzyme-serializer
. It's main purpose is compatibility with Jest'ssnapshotSerializers
option, so it no longer has a default export - it only hastest
&serialize
exports.. You can importcreateEnzymeSerializer
from the root entry (@emotion/jest
) and create your own serializer if needed.
cd77efbf
#1920 Thanks @Andarist! -@emotion/jest/serializer
's main purpose is compatibility with Jest'ssnapshotSerializers
option, so it no longer has a default export - it only hastest
&serialize
exports. You can importcreateSerializer
from the root entry (@emotion/jest
) and create your own serializer if needed.
- Updated dependencies [
58dc08a6
,f57a7229
,6d32d82b
]:- @emotion/react@11.0.0-next.14
- @emotion/css@11.0.0-next.14
ca599c5f
#1901 Thanks @Andarist! -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
(previouslyjest-emotion
) can't be used directly in thesnapshotSerializers
option, you should use@emotion/jest/serializer
instead for this.
ca599c5f
#1901 Thanks @Andarist! - Refactored to use new serializers API which has been introduced in Jest 21.
ca599c5f
#1901 Thanks @Andarist! - Fixed an issue with all styles being recognized as changed in Jest 25 on unrelated changed.
- Updated dependencies [
9e998e37
]:- @emotion/css@11.0.0-next.13
- @emotion/react@11.0.0-next.13
- Updated dependencies [
7dea6d7a
,105de5c8
,be2eb614
,5bea60b1
,75e2f9e1
,105de5c8
]:- @emotion/react@11.0.0-next.12
- @emotion/css@11.0.0-next.12
b8476e08
#1675 Thanks @mitchellhamilton! - Renamejest-emotion
to@emotion/jest
. Please replace"snapshotSerializers": ["jest-emotion"]
with"snapshotSerializers": ["@emotion/jest"]
if you're using the snapshot serializer. Also replace any imports ofjest-emotion
with@emotion/jest
or use the@emotion/pkg-renaming
ESLint rule from@emotion/eslint-plugin
.
b8476e08
#1675 Thanks @mitchellhamilton! - Improve support for Enzyme's shallow rendering with the addition of the @emotion/jest/enzyme snapshot serializer
- Updated dependencies [
b8476e08
,b8476e08
,affed3dd
,b8476e08
,d62d9101
]:- @emotion/react@11.0.0-next.10
- @emotion/css@11.0.0-next.10
- Updated dependencies [
5c55fd17
]:- @emotion/core@11.0.0-next.7
702f3fd2
#973 Thanks @spudly! - Added theT
parameter to theMatchers
interface in the TypeScript definitions to make this module compatible with@types/jest@^24.0.20
.
- Updated dependencies []:
- @emotion/core@11.0.0-next.4
- Updated dependencies [
a085003d
]:- @emotion/core@11.0.0-next.3
e67a5be9
#967 Thanks @Andarist! - Match rules in declarations with component used as a selector- Updated dependencies []:
- @emotion/core@11.0.0-next.1
302bdba1
#1600 Thanks @mitchellhamilton! - Ensure packages are major bumped so that pre-release versions of the linked packages are consistent in the major number
- Updated dependencies [
302bdba1
]:- @emotion/core@11.0.0-next.0
- emotion@11.0.0-next.0
4c62ae9
#1698 Thanks @Andarist! - Add LICENSE file- Updated dependencies [
4c62ae9
]:- @emotion/core@10.0.27
- emotion@10.0.27
b3c5b8de
#1667 Thanks @Andarist! - Revert improved support for Enzyme's shallow rendering - its release was an unforseen breaking change.
- fa5ffa80 #1477 Thanks @liamcmitchell-sc! - Fixed snapshots when using Enzyme serializer and its deep mode in combination with fragments
- c0eb604d #1419 Thanks @mitchellhamilton! - Update build tool