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.
 
 

24 lines
498 B

import test from 'ava';
import ow from '../source';
test('iterable', t => {
t.notThrows(() => {
ow([], ow.iterable);
});
t.notThrows(() => {
ow('foo', ow.iterable);
});
t.notThrows(() => {
ow(new Map(), ow.iterable);
});
t.throws(() => {
ow(12 as any, ow.iterable);
}, 'Expected argument to be of type `Iterable` but received type `number`');
t.throws(() => {
ow(12 as any, 'foo', ow.iterable);
}, 'Expected `foo` to be of type `Iterable` but received type `number`');
});