Skip to content

Commit

Permalink
chore(tests): use UTC date string in tests to be timezone independent (
Browse files Browse the repository at this point in the history
…#705)

Previously tests could break when run in a different timezone.
  • Loading branch information
Gelio committed Jan 11, 2021
1 parent fe8f589 commit e8fd805
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions __tests__/patch.js
Expand Up @@ -1131,7 +1131,7 @@ test("#676 patching Date objects", () => {
}

const [nextState, patches] = produceWithPatches({}, function(draft) {
draft.date = new Date(2020, 10, 10, 8, 8, 8, 3)
draft.date = new Date("2020-11-10T08:08:08.003Z")
draft.test = new Test()
})

Expand All @@ -1145,5 +1145,5 @@ test("#676 patching Date objects", () => {
expect(rebuilt.date.toJSON()).toMatchInlineSnapshot(
`"2020-11-10T08:08:08.003Z"`
)
expect(rebuilt.date).toEqual(new Date(2020, 10, 10, 8, 8, 8, 3))
expect(rebuilt.date).toEqual(new Date("2020-11-10T08:08:08.003Z"))
})

0 comments on commit e8fd805

Please sign in to comment.