From 4297fa2d349496b8cd1c7d1a2df70c7f15b27574 Mon Sep 17 00:00:00 2001 From: zhuyue Date: Mon, 6 Sep 2021 15:13:40 +0800 Subject: [PATCH] fix: Fix unit test case fix unit test case Change-Id: Id08e37e603a897e9da895e229fa2b82a460718d5 --- src/utils/index.test.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/index.test.js b/src/utils/index.test.js index 896d7e5d..f68974eb 100644 --- a/src/utils/index.test.js +++ b/src/utils/index.test.js @@ -141,8 +141,9 @@ describe('test utils index.js', () => { expect(toLocalTimeFilter(1622025465 * 1000)).toBe( moment.unix(1622025465).format(timeFormatStr.YMDHms) ); - expect(toLocalTimeFilter(moment().utc().format())).toBe( - moment().format(timeFormatStr.YMDHms) + const now = moment(); + expect(toLocalTimeFilter(now.clone().utc().format())).toBe( + now.clone().format(timeFormatStr.YMDHms) ); });