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.
 
 

10 lines
389 B

import test from 'ava';
import m from '..';
test('nan', t => {
t.notThrows(() => m(NaN, m.nan));
t.notThrows(() => m(Number.NaN, m.nan));
t.notThrows(() => m(0 / 0, m.nan));
t.throws(() => m(12, m.nan), 'Expected argument to be of type `nan` but received type `number`');
t.throws(() => m('12' as any, m.nan), 'Expected argument to be of type `nan` but received type `string`');
});