Completed
Push — master ( 3595da...162449 )
by
unknown
29s
created

test/callAPIMethod.spec.js   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 10
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

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

1 Function

Rating   Name   Duplication   Size   Complexity  
A callAPIMethod.spec.js ➔ ??? 0 7 1
1
import test from 'ava';
2
import { getAPIPrefix } from '../src/callAPIMethod';
3
4
test('getAPIPrefix', t => {
5
    t.is(getAPIPrefix('api'), '/api', 'relative path');
6
    t.is(getAPIPrefix('/api'), '/api', 'absolute path');
7
    t.is(getAPIPrefix('http://api.example.com'), 'http://api.example.com', 'http url');
8
    t.is(getAPIPrefix('https://api.example.com'), 'https://api.example.com', 'http url');
9
    t.is(getAPIPrefix('//api.example.com'), '//api.example.com', 'protocol-less url');
10
});