NMF-earth / nmf-app

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

Set timezone environment variable for Jest via global setup rather than by the Windows-incompatible command line statement #364

Closed ThomasLatham closed 1 year ago

ThomasLatham commented 1 year ago

✅ I have read the contributing file

Summary

As documented in #202, the command "TZ=" does not work in Windows (although it does work in MacOS and Linux), so tests would fail in Windows environments on account of an unrecognized command. This PR fixes the problem by instead setting the the timezone environment variable in a global-setup JavaScript file for Jest, thereby making such an action OS independent.

Note: According to the source for this fix, "The normal setupFiles did not work for me, since they run too late (jest: ^23.5.0). So it is mandatory to use the globalSetup file."

ghost commented 1 year ago
👇 Click on the image for a new way to code review - Make big changes easier — review code in small groups of related files - Know where to start — see the whole change at a glance - Take a code tour — explore the change with an interactive tour - Make comments and review — all fully sync’ed with github [Try it now!](https://app.codesee.io/r/reviews?pr=364&src=https%3A%2F%2Fgithub.com%2FNMF-earth%2Fnmf-app)

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map Legend

PierreBresson commented 1 year ago

Thanks @ThomasLatham 🙂🎄

ThomasLatham commented 1 year ago

Glad to be able to help!