-
Notifications
You must be signed in to change notification settings - Fork 122
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
Conversation
@@ -246,7 +351,8 @@ describe('The node.js OC client', function(){ | |||
components: [{ | |||
name: 'hello-world', | |||
version: '~1.0.0' | |||
}] | |||
}], | |||
parameters: {} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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' | ||
} |
There was a problem hiding this comment.
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 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here (3) ?
Thanks, excellent! |
fixes #185