Skip to content

Commit e8fd805

Browse files
authoredJan 11, 2021
chore(tests): use UTC date string in tests to be timezone independent (#705)
Previously tests could break when run in a different timezone.
1 parent fe8f589 commit e8fd805

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎__tests__/patch.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@ test("#676 patching Date objects", () => {
11311131
}
11321132

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

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

0 commit comments

Comments
 (0)