electricitymaps / bloom-contrib

Making carbon footprint data available to everyone.
https://www.bloomclimate.com
MIT License
436 stars 104 forks source link

Add currency conversion test #379

Closed corradio closed 4 years ago

corradio commented 4 years ago

Just wanted to be sure :)

madsnedergaard commented 4 years ago

This is great :) I have allowed myself to push a commit with a suggested change, if you disagree I'll just revert it.

Instead of getting currencies at runtime (with getAvailableCurrencies), I think it's better to have a defined constant so we catch errors before compile-time and have better editor support:

Screenshot 2020-04-06 at 09 04 29 Screenshot 2020-04-06 at 09 04 15

And to be sure they match, I have added a test that checks if UNIT_CURRENCIES match the list in exchange_rate.json

corradio commented 4 years ago

You rock! I'm checking this anyway but only because I want to :D

corradio commented 4 years ago

Feel free to approve/merge in my absence