diff --git a/tests/unit/utils/formatTime.spec.js b/tests/unit/utils/formatTime.spec.js index 2e8f635..2871518 100644 --- a/tests/unit/utils/formatTime.spec.js +++ b/tests/unit/utils/formatTime.spec.js @@ -1,7 +1,7 @@ import { formatTime } from '@/utils/index.js' describe('Utils:formatTime', () => { - const d = new Date(1531475641067) // "2018-07-13 17:54:01" + const d = new Date('2018-07-13 17:54:01') // "2018-07-13 17:54:01" it('test now', () => { expect(formatTime(+new Date() - 1)).toBe('刚刚') diff --git a/tests/unit/utils/parseTime.spec.js b/tests/unit/utils/parseTime.spec.js index 5efbbd7..b4e86b1 100644 --- a/tests/unit/utils/parseTime.spec.js +++ b/tests/unit/utils/parseTime.spec.js @@ -1,7 +1,7 @@ import { parseTime } from '@/utils/index.js' describe('Utils:parseTime', () => { - const d = new Date(1531475641067) // "2018-07-13 17:54:01" + const d = new Date('2018-07-13 17:54:01') // "2018-07-13 17:54:01" it('timestamp', () => { expect(parseTime(d)).toBe('2018-07-13 17:54:01') })