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.
 
 

12 lines
509 B

import test from 'ava';
import m from '..';
test('null', t => {
const x = null;
t.notThrows(() => m(null, m.null));
t.notThrows(() => m(x, m.null));
t.throws(() => m(undefined as any, m.null), 'Expected argument to be of type `null` but received type `undefined`');
t.throws(() => m(undefined as any, 'foo', m.null), 'Expected `foo` to be of type `null` but received type `undefined`');
t.throws(() => m('foo' as any, m.null), 'Expected argument to be of type `null` but received type `string`');
});