-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
Proposal - Response configuration (headers...) #156
Comments
Seems like a great idea ( to add the ability for headers ) .. the rest I don't love so much .. |
I kinda like the idea of a generic |
yes, that is a good point .. how about returnsHeaders? kinda long winded I know. mockQuery.returns({headers: "blah"}).with({models: [blah]}) it's actually not that much better than: mockQuery.returnsHeaders("blah").returnsModels([blah]) although .. now that I look at it .. your version is not too shabby .. hmm .. pondering |
I'll write a couple example snippets (tomorrow probably, if time allows) for a wider overview. Meanwhile, I won't mind |
Sure thing. I am starting to warm up to it. I guess I just want to have consistency around all the chainable methods for mockGet, mockCreate, etc .. if we can get a unified look .. I am all in. |
There are currently1 4 main mock classes:
Here's something that doesn't seem too much work and that, if applied, should be applied to all:
AFAICT, this can be fully backward compatible, deprecation warnings can be added where appropriate. Yep, no snippets, sorry, I'm being lazy right now. I'll do some or update the README examples if you require them. 1: a |
Gee, your not that lazy .. it's 7 am and you are scribbling away, writing up the ideas in a way that gets the ideas across .. and gives the full overview of what is going on .. and ... me like. |
I'm cheating, it's almost 2pm here (Berlin) ;) I took the liberty to create the corresponding issues. That way, feel free to self-assign what you want to work on, so we don't step on each other's foot 😉 As I quickly started work on #158, I'll happily finish it. |
And if you're ok with it, this issue can be closed, I guess. |
Sure thing, good idea about the separate issues. |
Hey,
I need to send some custom headers along with the data in the response, and there's currenty no way (that I know of) to do so.
The idea below is simply to add a generic
returns
method to the mocks that will handle a custom configuration object, likeBefore going deeper in the writing of that, I wanted to gather feedback and open the discussion.
Here's a quick draft of how it ould be quickly implemented:
What do you think?
The text was updated successfully, but these errors were encountered: