Skip to content

Commit

Permalink
fix(): check if null passed to objectSupport parser (#2175)
Browse files Browse the repository at this point in the history
  • Loading branch information
illjah42 authored Jun 22, 2023
1 parent c79e2f5 commit 013968f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/plugin/objectSupport.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,3 +390,11 @@ it('add decimal values of days and months', () => {
expect(dayjs([2016, 7, 1]).add(1.6, 'years').format('YYYY-MM-DD')).toBe('2017-07-01')
expect(dayjs([2016, 1, 1]).add(1.1, 'quarters').format('YYYY-MM-DD')).toBe('2016-04-01')
})

it('returns valid date on undefined', () => {
expect(dayjs().isValid()).toBe(true)
})

it('returns invalid date on null', () => {
expect(dayjs(null).isValid()).toBe(false)
})

0 comments on commit 013968f

Please sign in to comment.