-
Notifications
You must be signed in to change notification settings - Fork 27.4k
feat($http): provide a config object as an argument to header functions #10622
feat($http): provide a config object as an argument to header functions #10622
Conversation
84e1d28
to
d568960
Compare
+1, Nice! Please merge! |
@caitp / @petebacondarwin / @lgalfaso (or anyone else!) - would you guys mind reviewing this one - it is pretty minimal |
taking a quick gander |
|
||
expect(config.bar).toBeUndefined(); | ||
}); | ||
|
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.
should we also test the main functionality of this feature? :p
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.
@caitp it is tested as otherwise a mocked request would fail, no?
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.
let me check ngMock one sec... But in spite of that, I think you should have a different spec for that, because it's not explicitly testing that, it's explicitly testing that the passed in config object is a shallow copy
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.
Yep, I thought of splitting it into 2 separate specs when I saw your comment. Will create 2 separate specs.
Can you guys triage your own PRs please! |
d568960
to
31a463f
Compare
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
31a463f
to
d88e863
Compare
CLAs look good, thanks! |
I've rebased this one and split tests based on the review comments. |
I'll take a look on Monday |
$httpBackend.flush(); | ||
}); | ||
|
||
it('should not allow modifications to a config object in header functions', function() { |
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.
should ignore modifications (but no big deal)
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.
this will also only "ignore" changes to root properties of the config object, so changes to child object properties won't be ignored :( but I don't think it's worth worrying about it until someone complains
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.
yeh... but I agree that we shouldn't worry about it too much right now...
still lgtm |
This is a cleaned up / alternative version for #7235