jest-date-serializer
A custom serializer for jest that strips timezone offsets away from dates before serializing them. This will prevent failing snapshot tests when running them on machines with different timezone.
Installation
- Run
yarn add --dev jest-date-serializer
to add the serializer to your project - Add the serializer to your jest configuration.
Example configuration:
- All your dates will be stripped of timezone offsets 👯♀️