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.
11 lines
501 B
11 lines
501 B
import test from 'ava';
|
|
import m from '..';
|
|
|
|
test('iterable', t => {
|
|
t.notThrows(() => m([], m.iterable));
|
|
t.notThrows(() => m('foo', m.iterable));
|
|
t.notThrows(() => m(new Map(), m.iterable));
|
|
t.notThrows(() => m(new Map(), m.iterable.label('foo')));
|
|
t.throws(() => m(12 as any, m.iterable), 'Expected argument to be of type `Iterable` but received type `number`');
|
|
t.throws(() => m(12 as any, m.iterable.label('foo')), 'Expected `foo` to be of type `Iterable` but received type `number`');
|
|
});
|
|
|