tests/unit/curl.test.js   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 24
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 15
mnd 0
bc 0
fnc 2
dl 0
loc 24
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
1
import { URL } from 'url';
2
import { assert } from 'chai';
3
import { build } from '../../src/utils';
4
5
suite('Unit: cURL');
6
7
test('cURL: Get request', function () {
8
    assert.equal(
9
        build({ url: new URL('http://lon.co/imoma') }),
10
        'curl -X GET http://lon.co/imoma'
11
    );
12
});
13
14
test('cURL: headers', function () {
15
    assert.equal(
16
        build({
17
            url     : new URL('http://lon.co/imoma'),
18
            headers : {
19
                'API_KEY' : 'oUHvzb'
20
            }
21
        }),
22
        "curl -X GET -H 'API_KEY: oUHvzb' http://lon.co/imoma"
23
    );
24
});
25