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.
Last updated a year ago by tobilen .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install jest-date-serializer 
SYNC missed versions from official npm registry.

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

  1. Run yarn add --dev jest-date-serializer to add the serializer to your project
  2. Add the serializer to your jest configuration.

Example configuration:

{
"name": "my-awesome-project",
"devDependencies": {
  "jest": "^23.6.0",
  "jest-date-serializer": "^0.0.1"
},
"jest": {
    "snapshotSerializers": [
      "jest-date-serializer"
    ]
  },
}
  1. All your dates will be stripped of timezone offsets ????‍♀️

Current Tags

  • 1.0.4                                ...           latest (15 days ago)

9 Versions

  • 1.0.4                                ...           15 days ago
  • 1.0.3                                ...           15 days ago
  • 1.0.2                                ...           a month ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           2 years ago
  • 0.0.4                                ...           2 years ago
  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 36
Last Day 0
Last Week 8
Last Month 15
Dependencies (0)
None
Dev Dependencies (2)

Copyright 2014 - 2016 © taobao.org |