Total Complexity | 2 |
Complexity/F | 1 |
Lines of Code | 24 |
Function Count | 2 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 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 |