Skip to content

Commit

Permalink
test:relativeTime line 23 covered
Browse files Browse the repository at this point in the history
  • Loading branch information
zerooverture committed Apr 29, 2020
1 parent b9f7f46 commit 46ecb61
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/plugin/relativeTime.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import * as C from '../../src/constant'
import relativeTime from '../../src/plugin/relativeTime'
import utc from '../../src/plugin/utc'
import '../../src/locale/ru'
import en from '../../locale/en'


dayjs.extend(relativeTime)

Expand Down Expand Up @@ -137,3 +139,9 @@ it('Custom thresholds and rounding support', () => {
})
expect(dayjs().subtract(45, 'm').fromNow()).toBe('45 minutes ago')
})

it('Set the default language to en->There is no relativeTime property', () => {
const d = dayjs()
d.locale(en)
expect(d.subtract(45, 'm').fromNow('45 minutes ago'))
})

0 comments on commit 46ecb61

Please sign in to comment.