Skip to content

Commit

Permalink
fix: duration plugin getter get result 0 instead of undefined add test
Browse files Browse the repository at this point in the history
  • Loading branch information
iamkun committed Jul 10, 2023
1 parent 3f25a1a commit 958b2bb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/plugin/duration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ describe('Add', () => {
expect(a.add({ days: 5 }).days()).toBe(6)
})

describe('Add to a dayjs()', () => {
const a = dayjs()
const b = dayjs.duration({ hours: 7, minutes: 10 })
expect(a.add(b)).toEqual(a.add(7, 'hours').add(10, 'minutes'))
})

test('Add duration', () => {
const a = dayjs('2020-10-01')
const days = dayjs.duration(2, 'days')
Expand Down

0 comments on commit 958b2bb

Please sign in to comment.