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

callAPIMethod.spec.js ➔ ???   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
c 1
b 1
f 0
nc 1
dl 0
loc 7
rs 9.4285
nop 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
});