Total Complexity | 5 |
Complexity/F | 1 |
Lines of Code | 23 |
Function Count | 5 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | import test from 'ava'; |
||
2 | import { isAPIError } from '../../src/utils'; |
||
3 | import APIError from 'unity-api/dist/error'; |
||
4 | |||
5 | test('APIError', t => { |
||
6 | t.true(isAPIError(new APIError())) |
||
7 | }); |
||
8 | |||
9 | test('standard error', t => { |
||
10 | t.false(isAPIError(Error())) |
||
11 | }); |
||
12 | |||
13 | test('standard new error', t => { |
||
14 | t.false(isAPIError(new Error())) |
||
15 | }); |
||
16 | |||
17 | test('plain object', t => { |
||
18 | t.false(isAPIError({})) |
||
19 | }); |
||
20 | |||
21 | test('number', t => { |
||
22 | t.false(isAPIError(1)) |
||
23 | }); |