From 46ecb61bc1085d315e79725bf466c2b2b57c3eee Mon Sep 17 00:00:00 2001 From: Zero Date: Wed, 29 Apr 2020 23:15:03 +0800 Subject: [PATCH] test:relativeTime line 23 covered --- test/plugin/relativeTime.test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/plugin/relativeTime.test.js b/test/plugin/relativeTime.test.js index e8a26e0a3..7c84f71c6 100644 --- a/test/plugin/relativeTime.test.js +++ b/test/plugin/relativeTime.test.js @@ -5,6 +5,8 @@ import * as C from '../../src/constant' import relativeTime from '../../src/plugin/relativeTime' import utc from '../../src/plugin/utc' import '../../src/locale/ru' +import en from '../../locale/en' + dayjs.extend(relativeTime) @@ -137,3 +139,9 @@ it('Custom thresholds and rounding support', () => { }) expect(dayjs().subtract(45, 'm').fromNow()).toBe('45 minutes ago') }) + +it('Set the default language to en->There is no relativeTime property', () => { + const d = dayjs() + d.locale(en) + expect(d.subtract(45, 'm').fromNow('45 minutes ago')) +})