Skip to content

Commit 013968f

Browse files
authored
fix(): check if null passed to objectSupport parser (#2175)
1 parent c79e2f5 commit 013968f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/plugin/objectSupport.test.js

+8
Original file line numberDiff line numberDiff line change
@@ -390,3 +390,11 @@ it('add decimal values of days and months', () => {
390390
expect(dayjs([2016, 7, 1]).add(1.6, 'years').format('YYYY-MM-DD')).toBe('2017-07-01')
391391
expect(dayjs([2016, 1, 1]).add(1.1, 'quarters').format('YYYY-MM-DD')).toBe('2016-04-01')
392392
})
393+
394+
it('returns valid date on undefined', () => {
395+
expect(dayjs().isValid()).toBe(true)
396+
})
397+
398+
it('returns invalid date on null', () => {
399+
expect(dayjs(null).isValid()).toBe(false)
400+
})

0 commit comments

Comments
 (0)