Skip to content

Commit

Permalink
increases coverage of headersFor
Browse files Browse the repository at this point in the history
  • Loading branch information
ivoputzer committed Jan 15, 2019
1 parent 7ce604f commit fe6b790
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "coinbase-pro-api",
"version": "0.1.0",
"version": "0.1.1",
"description": "lightweight coinbase pro api implementation",
"main": "index.js",
"config": {
Expand Down
12 changes: 12 additions & 0 deletions test/client.js
Expand Up @@ -73,6 +73,18 @@ test('coinbase-pro-api/client', () => {
ok(headers.hasOwnProperty('CB-ACCESS-SIGN'))
ok(headers.hasOwnProperty('CB-ACCESS-TIMESTAMP'))
})

test('evn argument is allowed to be empty', () => {
const headers = headersFor({ method: 'get' }, {})

ok(headers.hasOwnProperty('User-Agent'))
ok(headers.hasOwnProperty('Accept'))
ok(headers.hasOwnProperty('Content-Type'))
ok(headers.hasOwnProperty('CB-ACCESS-KEY'))
ok(headers.hasOwnProperty('CB-ACCESS-PASSPHRASE'))
ok(headers.hasOwnProperty('CB-ACCESS-SIGN'))
ok(headers.hasOwnProperty('CB-ACCESS-TIMESTAMP'))
})
})

test('.toString', () => {
Expand Down

0 comments on commit fe6b790

Please sign in to comment.