tzhf / chatguessr

A Twitch chatbot for GeoGuessr.
https://chatguessr.com
MIT License
39 stars 12 forks source link

add tests for `getCountryCode` and `selectFlag` #11

Closed ReAnnannanna closed 2 years ago

ReAnnannanna commented 2 years ago

getCountryCode maps some country codes to each other to match GeoGuessr's streak behaviour, this adds a few tests so we can make sure that it actually does do the same thing.

Also some tests for selectFlag, I noticed it wasn't giving the british flag anymore for !flag uk. Tweaking the order in the names list makes match-sorter use the correct flag again.

Since the socket change added an import statement in GameHandler.js, parcel treats it as an ES module. I changed the other requires to match so both parcel and typescript are happy with it.

I also added a github actions workflow so tests and typechecks are run on PRs. we dont need to take it super seriously probably but it's nice as an indication.