Completed
Push — master ( 2040ba...cef9c4 )
by Vitaly
02:22
created

test/error.spec.js   A

Complexity

Total Complexity 5
Complexity/F 1

Size

Lines of Code 22
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 22
rs 10
bpm 1
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A error.spec.js ➔ ??? 0 3 1
1
import test from 'ava';
2
import APIError from '../src/error';
3
4
test.beforeEach(t => {
5
    t.context.error = new APIError(404, 'Not Found');
6
});
7
8
test('instance of Error', t => {
9
    t.true(t.context.error instanceof Error)
10
});
11
12
test('instance of APIError', t => {
13
    t.true(t.context.error instanceof APIError)
14
});
15
16
test('to string', t => {
17
    t.is(t.context.error.toString(), '404 - Not Found')
18
});
19
20
test.failing('Error.isError', t => {
21
    t.true(Error.isError(t.context.error))
22
});
23