From 4bdc8f9f1de67fde3e1af4b0a40db7179d81921c Mon Sep 17 00:00:00 2001 From: iamkun Date: Fri, 26 Apr 2019 14:01:05 +0800 Subject: [PATCH] test: Update localizedFormat test --- test/plugin/localizedFormat.test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/plugin/localizedFormat.test.js b/test/plugin/localizedFormat.test.js index 81c75ad3f..24dd8df04 100644 --- a/test/plugin/localizedFormat.test.js +++ b/test/plugin/localizedFormat.test.js @@ -2,7 +2,6 @@ import MockDate from 'mockdate' import moment from 'moment' import dayjs from '../../src' import es from '../../src/locale/es' -import ar from '../../src/locale/ar' import localizedFormat from '../../src/plugin/localizedFormat' dayjs.extend(localizedFormat) @@ -52,11 +51,12 @@ it('Uses English formats in other locales as default', () => { const date = new Date() const actualDate = dayjs(date) const expectedDate = moment(date) - // todo: ar here isn't a good fix here - const arOldFormats = ar.formats - ar.formats = {} - expect(actualDate.locale(ar).format('L')).toBe(expectedDate.format('L')) - ar.formats = arOldFormats + const mockLocale = { + name: 'mock', + weekdays: Array(7).fill(' '), + months: Array(12).fill(' ') + } + expect(actualDate.locale(mockLocale).format('L')).toBe(expectedDate.format('L')) }) it('Leaves the default format intact', () => {