UNPKG

694 BJavaScriptView Raw
1
2import { isType } from './swu-structure';
3
4it('should pass', () => {
5 expect(true).toBe(true);
6})
7
8it('should check symbol types', () => {
9 expect(isType('񀀁', 'hand')).toBe(true);
10 expect(isType('񀀁', 'head')).toBe(false);
11 expect(isType('񋾡', 'hand')).toBe(false);
12 expect(isType('񋾡', 'head')).toBe(true);
13})
14
15it('should not break isType on bad input', () => {
16 expect(isType()).toBe(false);
17 expect(isType(5)).toBe(false);
18 expect(isType(['what'])).toBe(false);
19 expect(isType('S10000')).toBe(false);
20 expect(isType('S10000', 5)).toBe(false);
21 expect(isType('S10000', ['a'])).toBe(false);
22 expect(isType('S10000', 'unavailable')).toBe(false);
23})