Completed
Push — master ( 005b6e...3a071c )
by Vitaly
01:21
created

test/utils/isAPIError.spec.js   A

Complexity

Total Complexity 5
Complexity/F 1

Size

Lines of Code 23
Function Count 5

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 5
c 1
b 0
f 0
nc 1
mnd 0
bc 5
fnc 5
dl 0
loc 23
rs 10
bpm 1
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A isAPIError.spec.js ➔ ??? 0 3 1
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
});