chore(deps-dev): bump prettier from 1.19.1 to 2.0.2

This commit is contained in:
DIYgod
2020-04-02 21:21:46 +08:00
parent 27e4a7c151
commit 0e7b14e718
471 changed files with 1237 additions and 4457 deletions

View File

@@ -17,78 +17,30 @@ describe('dateParser', () => {
// Test of input as a string of UTC Time
test(`UTCString`, () => {
expect(
dateParser(
dayjs
.utc(now.toUTCString())
.locale('en')
.format('YYYY-MM-DD HH:mm:ss')
)
).toBe(now.toUTCString());
expect(dateParser(dayjs.utc(now.toUTCString()).locale('en').format('YYYY-MM-DD HH:mm:ss'))).toBe(now.toUTCString());
});
// Test of input as a string of local time with timezone in ISO 8601
test(`ISO 8601`, () => {
expect(
dateParser(
dayjs(now.toUTCString())
.locale('en')
.format('YYYY-MM-DDTHH:mm:ssZ')
)
).toBe(now.toUTCString());
expect(dateParser(dayjs(now.toUTCString()).locale('en').format('YYYY-MM-DDTHH:mm:ssZ'))).toBe(now.toUTCString());
});
// Test of input as a string of local time with timezone set by htmlOffset
test(`htmlOffset`, () => {
expect(
dateParser(
dayjs(now.toUTCString())
.locale('en')
.format('YYYY-MM-DDTHH:mm:ss'),
null,
'en',
serverOffset
)
).toBe(now.toUTCString());
expect(dateParser(dayjs(now.toUTCString()).locale('en').format('YYYY-MM-DDTHH:mm:ss'), null, 'en', serverOffset)).toBe(now.toUTCString());
});
// Test of input as a string of UTC Time with week
test(`en UTCString with week`, () => {
expect(
dateParser(
dayjs
.utc(now.toUTCString())
.locale('en')
.format('dddd, DD MMMM YYYY HH:mm:ss'),
'DD MMMM YYYY HH:mm:ss'
)
).toBe(now.toUTCString());
expect(dateParser(dayjs.utc(now.toUTCString()).locale('en').format('dddd, DD MMMM YYYY HH:mm:ss'), 'DD MMMM YYYY HH:mm:ss')).toBe(now.toUTCString());
});
test(`zh-cn UTCString with week`, () => {
expect(
dateParser(
dayjs
.utc(now.toUTCString())
.locale('zh-cn')
.format('dddd, DD MMMM YYYY HH:mm:ss'),
'DD MMMM YYYY HH:mm:ss',
'zh-cn'
)
).toBe(now.toUTCString());
expect(dateParser(dayjs.utc(now.toUTCString()).locale('zh-cn').format('dddd, DD MMMM YYYY HH:mm:ss'), 'DD MMMM YYYY HH:mm:ss', 'zh-cn')).toBe(now.toUTCString());
});
test(`zh-hant UTCString with week`, () => {
expect(
dateParser(
dayjs
.utc(now.toUTCString())
.locale(dateParser.i8nconv('zh-hant'))
.format('dddd, DD MMMM YYYY HH:mm:ss'),
'DD MMMM YYYY HH:mm:ss',
'zh-hant'
)
).toBe(now.toUTCString());
expect(dateParser(dayjs.utc(now.toUTCString()).locale(dateParser.i8nconv('zh-hant')).format('dddd, DD MMMM YYYY HH:mm:ss'), 'DD MMMM YYYY HH:mm:ss', 'zh-hant')).toBe(now.toUTCString());
});
// fallback