Skip to content

Commit

Permalink
fix(): check if null passed to objectSupport parser (iamkun#2175)
Browse files Browse the repository at this point in the history
  • Loading branch information
illjah42 authored and ohsory1324 committed Dec 20, 2023
1 parent 858554a commit 5757b07
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 5757b07

Please sign in to comment.