Part of the power of snapshots is the ability to provide custom serializers. Let’s check out how to use jest-emotion to include our emotion CSS styles in our React component snapshots so we can be made aware of the impact of our CSS changes on our components.

UPDATE: jest-emotion has been renamed to @emotion/jest and you add the serializer with '@emotion/jest/serializer' instead of simply 'jest-emotion'.


Test an Emotion Styled UI with Custom Jest Snapshot Serializers