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
Mocking setTimezoneOffset #341
Comments
Why is that - the source code indicates this should work https://github.com/sinonjs/fake-timers/blob/master/src/fake-timers-src.js#L181 |
Ah I stand corrected! That does appear to work. Well in that case I suppose the only reason is that a Thanks for a great library! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@andrewplummer If you want to see this happening the source code is quite readable and easy to grok, so I think a PR could be whipped up in less than an hour 😉 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
It would be very nice to have a way to mock the system timezone offset, ie. override
Date.prototype.getTimezoneOffset
.I realize that this is possible and not very hard without
fake-timers
, however given that it hijacks the globalDate
object, if you were to do this the order of applying the mocks would then become a consideration (ie. if you were to mockDate.prototype.getTimezoneOffset
and then callFakeTimers.install
your mock would be shadowed and inaccessible).I realize that this package is doing a lot and timezones aren't really its main intent, but since it is mocking the
Date
object it makes sense to me that mocking this method also could/should be something that it does.The text was updated successfully, but these errors were encountered: