-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
test.sh fails in some timezones #21112
Comments
I (kind of) fixed a similar issue by changing time to 12.00 in another PR. There are still timezone where it will fail, but are very few. I think it is reasonable to do the same here. I suspect that using jasmine's mock clock would be a better solution for such cases 😃 |
I don't think that Jasmine.clock() can be useful here as it only mocks calls to However, why not simply passing an ISOString including a timezone to it ? (i.e. '2017-05-07T22:14:39+0000') EDIT : actually, it doesn't matter as the datePipe outputs a formatted date in the local TZ (it uses Date.prototype.getHours() and similar methods which all are local time dependents). So passing a TZ in the ISOString is of no value (cf the failed test referenced in this issue). So yeah, maybe using 12:00 is the least worst way of solving this. |
Thanks! Will look into it! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a...
Current behavior
I'm living in UTC+7, which makes this test fails:
https://github.com/angular/angular/blob/master/packages/common/test/pipes/date_pipe_spec.ts#L268..L269
Since the specified date in the test is 21st of Jaunary, 2017 in my timezone.
Expected behavior
Some documentation stating that this test is expected to fail in some timezones. Or any other workarounds.
Minimal reproduction of the problem with instructions
test.sh browser
What is the motivation / use case for changing the behavior?
Environment
The text was updated successfully, but these errors were encountered: