Skip to content

Commit

Permalink
test(test): rm self test utils func
Browse files Browse the repository at this point in the history
  • Loading branch information
iamkun committed Apr 13, 2018
1 parent 62dc22e commit 5ad890e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions test/display.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ afterEach(() => {
MockDate.reset()
})

// result in millisecond might cause little different in millisecond which is acceptable
const ignoreLastNumber = num => (String(num).slice(0, -1))

test('Format no formatStr', () => {
expect(dayjs().format()).toBe(moment().format())
})
Expand Down Expand Up @@ -70,11 +67,11 @@ it('Difference', () => {

const momentA = moment()
const momentB = moment(dateString)
expect(ignoreLastNumber(dayjsA.diff(dayjsB))).toBe(ignoreLastNumber(momentA.diff(momentB)))
expect(dayjsA.diff(dayjsB)).toBe(momentA.diff(momentB))
})

it('Unix Timestamp (milliseconds)', () => {
expect(ignoreLastNumber(dayjs().valueOf())).toBe(ignoreLastNumber(moment().valueOf()))
expect(dayjs().valueOf()).toBe(moment().valueOf())
})

it('Unix Timestamp (seconds)', () => {
Expand Down

0 comments on commit 5ad890e

Please sign in to comment.