-
Notifications
You must be signed in to change notification settings - Fork 27.4k
fix(ngMock): httpBackend match data with dates (1.2.2 regression) #5127
Conversation
Thanks for the PR!
If you need to make changes to your pull request, you can update the commit with Thanks again for your help! |
signed CLA as Bastien Caudan |
LGTM |
Expecting a request with a data object containing a date was failing.
The JSON serialization/deserialization of data could be a bit a confusing:
So, I tried to work on another implementation traversing the parsed JSON object to convert date strings into date objects:
This implementation is faster and seems more readable to me but unfortunately does not work on IE8...
Maybe someone would have other thoughts on this issue. |
02dc2aa
to
fd2d6c0
Compare
cad9560
to
f294244
Compare
e8dc429
to
e83fab9
Compare
4dd5a20
to
998c61c
Compare
I need it too. |
It is still not working on angular 1.3.0, plunker :( |
This is mocking code. I think we should go with your initial idea. |
…orrectly If a response or expectation contained a date object then `$httpBackend.expect` was not matching correctly. This commit encodes then decodes the object being matched to ensure consistency. Closes #5127
Expecting a request with a data object containing a date fails.
Use serialization/deserialization of data to have the same date format as the expectation.