forked from orbit-oss/is
Add .validDate() (#203)
This commit is contained in:
parent
0e687a23a8
commit
e9418fe1b9
3 changed files with 56 additions and 0 deletions
11
test/test.ts
11
test/test.ts
|
|
@ -2101,6 +2101,17 @@ test('is.urlSearchParams', t => {
|
|||
});
|
||||
});
|
||||
|
||||
test('is.validDate', t => {
|
||||
t.true(is.validDate(new Date()));
|
||||
t.false(is.validDate(new Date('x')));
|
||||
t.notThrows(() => {
|
||||
assert.validDate(new Date());
|
||||
});
|
||||
t.throws(() => {
|
||||
assert.validDate(new Date('x'));
|
||||
});
|
||||
});
|
||||
|
||||
test('is.validLength', t => {
|
||||
t.true(is.validLength(1));
|
||||
t.true(is.validLength(0));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue