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.
 
 

20 lines
448 B

import test from 'ava';
import ow from '../source';
test('symbol', t => {
t.notThrows(() => {
ow(Symbol.iterator, ow.symbol);
});
t.notThrows(() => {
ow(Symbol('foo'), ow.symbol);
});
t.throws(() => {
ow(12 as any, ow.symbol);
}, 'Expected argument to be of type `symbol` but received type `number`');
t.throws(() => {
ow(12 as any, 'foo', ow.symbol);
}, 'Expected `foo` to be of type `symbol` but received type `number`');
});