Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client#renderComponents accepts global parameters #303

Merged
merged 2 commits into from
Oct 11, 2016

Conversation

jankowiakmaria
Copy link
Collaborator

fixes #185

@@ -246,7 +351,8 @@ describe('The node.js OC client', function(){
components: [{
name: 'hello-world',
version: '~1.0.0'
}]
}],
parameters: {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uhm, why an empty parameters here? Just to test you can pass an empty object and that still works?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's because of the way renderComponent works (https://github.com/opentable/oc/blob/master/client/src/index.js#L26-L43). It uses renderComponents behind the scenes (which by default passes empty object as global parameters) - that's why expectedRequest contains parameters.

In case of the other two tests - the same thing, we're using renderComponents and in options (for renderComponent) we pass parameters which means they become global in internal renderComponents call.

}],
parameters: {
hi: 'john'
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess same reason here (2)

parameters: {
errorType: 'timeout',
timeout: 1000
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here (3) ?

@matteofigus
Copy link
Member

Thanks, excellent!

@matteofigus matteofigus merged commit 850df0b into master Oct 11, 2016
@matteofigus matteofigus deleted the ClientGlobalParameters branch October 11, 2016 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Client#renderComponents should accept global parameters
2 participants