NMF-earth / nmf-app

Understand and reduce your carbon footprint 🌱 iOS & Android.
https://nmf.earth
GNU General Public License v3.0
498 stars 156 forks source link

Fix `yarn test` on Windows #202

Closed adamfitzgibbon closed 1 year ago

adamfitzgibbon commented 3 years ago

The yarn test command (which is also run on the pre-commit hook) includes a command for changing the TZ environment variable to GMT. This does not work for Windows, and a short search around revealed that there's not an easy way update that variable for windows. It can be removed manually when trying to run tests, but it runs jest in your local timezone instead of GMT which messes up the dates in the snapshots.

We need to figure out if there's a way to configure jest to use GMT by default to alleviate this issue.

PierreBresson commented 3 years ago

https://github.com/NMF-earth/nmf-app/pull/210 could be a solution, but we need a proper research on the side effects

ThomasLatham commented 1 year ago

As a Windows user (I'd really like to switch to Linux, but laziness), I encountered this problem while trying to commit some changes for #236. I implemented this solution, and it worked insofar as I was able to commit to my feature branch in my local repo. Can I submit a PR?

PierreBresson commented 1 year ago

Hi @ThomasLatham, Looks like a suitable solution. Just make sure to submit two PRs

ThomasLatham commented 1 year ago

Okay @PierreBresson. By two PRs, are you referring to one for this issue and one for #236? Or two for this issue?

PierreBresson commented 1 year ago

Yes, one for this pr and one for the other

ThomasLatham commented 1 year ago

Okay