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
374 B

import test from 'ava';
import m from '..';
test('regExp', t => {
t.notThrows(() => m(/\d/, m.regExp));
t.notThrows(() => m(new RegExp('\d'), m.regExp));
t.throws(() => m('foo', m.regExp), 'Expected argument to be of type `regExp` but received type `string`');
t.throws(() => m(12, m.regExp), 'Expected argument to be of type `regExp` but received type `number`');
});