forked from 1-liners/1-liners
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathisTypeOf.js
More file actions
25 lines (23 loc) · 755 Bytes
/
Copy pathisTypeOf.js
File metadata and controls
25 lines (23 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import {ok} from 'assert';
import isTypeOf from '../isTypeOf';
test('#isTypeOf', () => {
ok(isTypeOf('boolean', false));
ok(isTypeOf('boolean', true));
ok(isTypeOf('string', '1-liners'));
ok(isTypeOf('number', 1));
ok(isTypeOf('object', {}));
ok(!isTypeOf('boolean', undefined));
ok(!isTypeOf('boolean', null));
ok(!isTypeOf('boolean', ''));
ok(!isTypeOf('boolean', '1'));
ok(!isTypeOf('boolean', 0));
ok(!isTypeOf('boolean', 1));
ok(!isTypeOf('boolean', NaN));
ok(!isTypeOf('boolean', Infinity));
ok(!isTypeOf('boolean', 'non-empty string'));
ok(!isTypeOf('boolean', () => {}));
ok(!isTypeOf('boolean', function named() {}));
ok(!isTypeOf('boolean', []));
ok(!isTypeOf('boolean', {}));
ok(!isTypeOf('boolean', /anything else/));
});