Major Changes
-
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
.
Minor Changes
-
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! - Improved printing of nested at-rules. -
ca599c5f
#1901 Thanks @Andarist! - Fixed an issue with all styles being recognized as changed in Jest 25 on unrelated changes.
Patch Changes
-
e67a5be9
#1604 Thanks @Andarist! - Take specificity into account when matching styles -
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. -
e67a5be9
#1604 Thanks @Andarist! - Match rules in declarations with component used as a selector -
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