walrus icon indicating copy to clipboard operation
walrus copied to clipboard

Make time tests time-zone-independent

Open jeremyruppel opened this issue 12 years ago • 3 comments

@kagd added a test for 0600 in #28, but it would be great if we didn't have to deal with that BS.

jeremyruppel avatar Jul 10 '12 03:07 jeremyruppel

We can probably just convert the time that is being passed to UTC time since that will remain constant.

kagd avatar Jul 13 '12 17:07 kagd

The tricky part with this one is that we typically don't want to display UTC to the user; it'll more likely be in their local time zone. So, what would be nice is to always have the test suite run in a specific time zone (doesn't matter which one).

I was thinking something like https://github.com/vesln/timekeeper might be of use here. Freeze time in a certain zone before the time-dependent tests.

jeremyruppel avatar Jul 13 '12 17:07 jeremyruppel

Good point. I will try that out and see if I can get something working.

kagd avatar Jul 13 '12 17:07 kagd