Add is.truthy() and is.falsy() (#25)
This commit is contained in:
parent
cdd4829edf
commit
dfcdfc3a83
3 changed files with 37 additions and 1 deletions
17
test.js
17
test.js
|
|
@ -289,6 +289,23 @@ test('is.dataView', t => {
|
|||
testType(t, 'arrayBuffer');
|
||||
});
|
||||
|
||||
test('is.truthy', t => {
|
||||
t.true(m.truthy('unicorn'));
|
||||
t.true(m.truthy('🦄'));
|
||||
t.true(m.truthy(new Set()));
|
||||
t.true(m.truthy(Symbol('🦄')));
|
||||
t.true(m.truthy(true));
|
||||
});
|
||||
|
||||
test('is.falsy', t => {
|
||||
t.true(m.falsy(false));
|
||||
t.true(m.falsy(0));
|
||||
t.true(m.falsy(''));
|
||||
t.true(m.falsy(null));
|
||||
t.true(m.falsy(undefined));
|
||||
t.true(m.falsy(NaN));
|
||||
});
|
||||
|
||||
test('is.nan', t => {
|
||||
testType(t, 'nan');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue