-
Notifications
You must be signed in to change notification settings - Fork 8
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
Raise test coverage #49
Conversation
73db7b5
to
11fa90f
Compare
From 97.2% to 100%. * Removed unnecessary guard clauses in things I borrowed from AngularJS source code (mostly for IE8 support). * Used $filter instead of manually removing elements from array in removeFallback(). * Disable video and screenshots on SauceLabs as the tests aren't visual. * Added tests to better flex the query handling feature in #23. ** Testing array of objects. ** Undefined and empty URL param values. ** Date-type in params object. Closes #44
11fa90f
to
3a430f4
Compare
We used Date.prototype.toISOString(), which wasn’t supported on IE8. Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global _Objects/Date/toISOString Fixes #51
3a430f4
to
3a1ac50
Compare
Empty/undefined query param values won’t be included in the mock data file path. They were inconsistent anyway. Fixes #48
@@ -68,7 +69,28 @@ angular.module('apiMock', []) | |||
return keys; | |||
} | |||
|
|||
// Taken from Angular 1.4.x: https://github.com/angular/angular.js/blob/f13852c179ffd9ec18b7a94df27dec39eb5f19fc/src/Angular.js#L296 | |||
// TODO: IE8: remove when we drop IE8/Angular 1.2 support. |
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.
Why IE8 support? For coverage?
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.
The hint is right there in the comment: we support Angular 1.2. So then we need to support whatever browsers it supports, which includes IE8.
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.
Fair enough!
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.
👍
From 97.2% to 100%.
source code (mostly for IE8 support).
removeFallback().
Closes #44
Fixes #51, #48