diff --git a/test/utils/date.js b/test/utils/date.js index 7dff7d299..98499a3d3 100644 --- a/test/utils/date.js +++ b/test/utils/date.js @@ -34,6 +34,10 @@ describe('date', () => { expect(+new Date(parseDate('昨天 20:00'))).toBe(+new Date('2018-12-31 20:00')); }); + it('前天 H:m', async () => { + expect(+new Date(parseDate('前天 20:00'))).toBe(+new Date('2018-12-30 20:00')); + }); + it('Y年M月D日H时', async () => { expect(+new Date(parseDate('2018年4月2日1时'))).toBe(+new Date('2018-4-2 01:00')); }); @@ -46,6 +50,14 @@ describe('date', () => { expect(+new Date(parseDate('2-3 02:03'))).toBe(+new Date('2019-2-3 02:03')); }); + it('Y/M/D H:m', async () => { + expect(+new Date(parseDate('2018/4/2 02:03'))).toBe(+new Date('2018-4-2 02:03')); + }); + + it('M/D H:m', async () => { + expect(+new Date(parseDate('2/3 02:03'))).toBe(+new Date('2019-2-3 02:03')); + }); + it('M月D日 H:m', async () => { expect(+new Date(parseDate('2月3日 02:03'))).toBe(+new Date('2019-2-3 02:03')); });