fix: failing tests with dates in local time#4412
fix: failing tests with dates in local time#4412acinader merged 2 commits intoparse-community:masterfrom
Conversation
|
Locally test pass but Travis is failing. |
Codecov Report
@@ Coverage Diff @@
## master #4412 +/- ##
=========================================
+ Coverage 92.79% 92.8% +0.01%
=========================================
Files 119 119
Lines 8522 8522
=========================================
+ Hits 7908 7909 +1
+ Misses 614 613 -1
Continue to review full report at Codecov.
|
|
I can confirm I receive this error message when building tests locally as well. |
| isLocalTime: false | ||
| })).toBe('2007-04-05T14:30:00.000Z', 'Timezone offset'); | ||
|
|
||
| const noTimezone = new Date('2017-09-06T17:14:01.048') |
There was a problem hiding this comment.
@marvelm could you have a look please? As you were originally building that feature.
Thanks!
There was a problem hiding this comment.
I've checked both of these changes and they are consistent with what should be happening.
PushController.formatPushTime converts to UTC and then strips the timezone if isLocalTime is set to true. The issue here is that the test expects the hour to be the same, but if the local timezone is not set to UTC, the hour will be different.
This change fixes the issue and two tests run as a result.
I submitted a PR to merge the latest changes into this branch and then it should be good to merge imo.
maciej-ka#1
Good morning!
This is a fix for tests that fail because expected dates ignore that machine local time can be in non zero timezones.
Closes: #4411