Total Complexity | 1 |
Complexity/F | 1 |
Lines of Code | 10 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
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 | }); |