Skip to content

Commit 5ad890e

Browse files
committed
test(test): rm self test utils func
1 parent 62dc22e commit 5ad890e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

test/display.test.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ afterEach(() => {
1010
MockDate.reset()
1111
})
1212

13-
// result in millisecond might cause little different in millisecond which is acceptable
14-
const ignoreLastNumber = num => (String(num).slice(0, -1))
15-
1613
test('Format no formatStr', () => {
1714
expect(dayjs().format()).toBe(moment().format())
1815
})
@@ -70,11 +67,11 @@ it('Difference', () => {
7067

7168
const momentA = moment()
7269
const momentB = moment(dateString)
73-
expect(ignoreLastNumber(dayjsA.diff(dayjsB))).toBe(ignoreLastNumber(momentA.diff(momentB)))
70+
expect(dayjsA.diff(dayjsB)).toBe(momentA.diff(momentB))
7471
})
7572

7673
it('Unix Timestamp (milliseconds)', () => {
77-
expect(ignoreLastNumber(dayjs().valueOf())).toBe(ignoreLastNumber(moment().valueOf()))
74+
expect(dayjs().valueOf()).toBe(moment().valueOf())
7875
})
7976

8077
it('Unix Timestamp (seconds)', () => {

0 commit comments

Comments
 (0)