annotated-graphql
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -67,2 +67,3 @@ 'use strict'; | ||
restArgs = { | ||
headers: { 'User-Agent': 'annotated-graphql' }, | ||
parameters: filterEmptyParameters(graphqlArgs, restSchemaAnnotation.parameters || Object.keys(graphqlArgs)) | ||
@@ -69,0 +70,0 @@ }; |
@@ -13,2 +13,6 @@ 'use strict'; | ||
var httpHeaders = { | ||
'User-Agent': 'annotated-graphql' | ||
}; | ||
describe('RestSchemaAnnotation', function () { | ||
@@ -82,3 +86,3 @@ describe('apply()', function () { | ||
_sinon2.default.assert.calledWith(restClient.get, 'http://foo.com/bar', { parameters: {} }); | ||
_sinon2.default.assert.calledWith(restClient.get, 'http://foo.com/bar', extendWithDefaults({ parameters: {} })); | ||
@@ -100,3 +104,3 @@ return result.should.be.fulfilledWith('foo'); | ||
_sinon2.default.assert.calledWith(restClient.post, 'http://foo.com/bar', { parameters: { bar: 'bar', baz: 'baz' } }); | ||
_sinon2.default.assert.calledWith(restClient.post, 'http://foo.com/bar', extendWithDefaults({ parameters: { bar: 'bar', baz: 'baz' } })); | ||
@@ -116,3 +120,3 @@ return result.should.be.fulfilledWith('foo'); | ||
_sinon2.default.assert.calledWith(restClient.get, 'http://foo.com/bar', { parameters: { baz: 'baz' } }); | ||
_sinon2.default.assert.calledWith(restClient.get, 'http://foo.com/bar', extendWithDefaults({ parameters: { baz: 'baz' } })); | ||
@@ -132,3 +136,3 @@ return result.should.be.fulfilledWith('foo'); | ||
_sinon2.default.assert.calledWith(restClient.get, 'http://foo.com/bar', { parameters: { baz: 'baz' } }); | ||
_sinon2.default.assert.calledWith(restClient.get, 'http://foo.com/bar', extendWithDefaults({ parameters: { baz: 'baz' } })); | ||
@@ -138,2 +142,6 @@ return result.should.be.fulfilledWith('foo'); | ||
}); | ||
function extendWithDefaults(restClientArgs) { | ||
return Object.assign({}, { headers: httpHeaders }, restClientArgs); | ||
} | ||
}); |
{ | ||
"name": "annotated-graphql", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Annotated GraphQL", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
56110
1394