Test Failed
Push — master ( 1271ab...04a38e )
by Dmytro
03:35 queued 11s
created

tests/mock/utils.js   A

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 13
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
mnd 0
bc 0
fnc 2
dl 0
loc 13
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A utils.js ➔ axiosError 0 7 1
A utils.js ➔ axiosResponse 0 3 1
1
import API_ERROR from 'base-api-client/lib/Error';
2
3
export function axiosResponse(data) {
4
    return { data: { result: data } };
5
}
6
7
export function axiosError(message, data) {
8
    const err = new Error(message);
9
10
    err.response = { data };
11
12
    return new API_ERROR(err);
13
}
14