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
560 B
14 lines
560 B
7 years ago
|
import test from 'ava';
|
||
|
import m from '..';
|
||
|
|
||
|
test('undefined', t => {
|
||
|
let x; // tslint:disable-line:prefer-const
|
||
|
const y = 12;
|
||
|
|
||
|
t.notThrows(() => m(undefined, m.undefined));
|
||
|
t.notThrows(() => m(x, m.undefined));
|
||
|
t.throws(() => m(y, m.undefined), 'Expected argument to be of type `undefined` but received type `number`');
|
||
|
t.throws(() => m(null, m.undefined), 'Expected argument to be of type `undefined` but received type `null`');
|
||
|
t.throws(() => m('foo', m.undefined), 'Expected argument to be of type `undefined` but received type `string`');
|
||
|
});
|