From ff14603be64382430741d7d14c44f1596d65240b Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Tue, 1 Mar 2022 11:05:32 -0500 Subject: [PATCH] Fix formatDuration test to be stable (#4944) --- src/common/utils/__tests__/formatDuration.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/utils/__tests__/formatDuration.test.ts b/src/common/utils/__tests__/formatDuration.test.ts index a10818ab2b..3c42db9060 100644 --- a/src/common/utils/__tests__/formatDuration.test.ts +++ b/src/common/utils/__tests__/formatDuration.test.ts @@ -55,7 +55,7 @@ describe("human format durations", () => { }); test("durations less than 8 years returns years and days", () => { - const timeValue = Date.now() - new Date(moment().subtract(2, "years").subtract(5, "days").subtract(2, "hours").toDate()).getTime(); + const timeValue = new Date(2020, 0, 10, 12, 0, 0, 0).getTime() - new Date(2018, 0, 4, 12, 0, 0, 0).getTime(); const res = formatDuration(timeValue);