mirror of https://github.com/lukechilds/ow.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
444 B
14 lines
444 B
7 years ago
|
import test from 'ava';
|
||
|
import m from '..';
|
||
|
|
||
|
test('nullOrUndefined', t => {
|
||
|
const x = null;
|
||
|
const y = undefined;
|
||
|
|
||
|
t.notThrows(() => m(null, m.nullOrUndefined));
|
||
|
t.notThrows(() => m(undefined, m.nullOrUndefined));
|
||
|
t.notThrows(() => m(x, m.nullOrUndefined));
|
||
|
t.notThrows(() => m(y, m.nullOrUndefined));
|
||
|
t.throws(() => m('foo' as any, m.nullOrUndefined), 'Expected argument to be of type `nullOrUndefined` but received type `string`');
|
||
|
});
|