From e8fd805740f1b0ae788470b93615e51e9bc887a3 Mon Sep 17 00:00:00 2001 From: Grzegorz Rozdzialik Date: Mon, 11 Jan 2021 21:27:57 +0100 Subject: [PATCH] chore(tests): use UTC date string in tests to be timezone independent (#705) Previously tests could break when run in a different timezone. --- __tests__/patch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/__tests__/patch.js b/__tests__/patch.js index 7baba6e5..1d013b91 100644 --- a/__tests__/patch.js +++ b/__tests__/patch.js @@ -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() }) @@ -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")) })