GeoFS-Extensions / autoland

Accessible plugins for GeoFS, an online flight simulator.
https://geofsautoland.wixsite.com/autoland
GNU General Public License v3.0
6 stars 2 forks source link

[feat]: Create unit tests #63

Closed nicolas377 closed 2 years ago

nicolas377 commented 3 years ago

Is your feature request related to a problem? If so, please explain. There's not really a good way to test PRs besides manual review, which isn't really good.

What would you like added? Comprehensive tests that run on the tests.yml action and can be accessed by a npm test script.

Check out this test by Mobile First for "inspiration" wink wink

nicolas377 commented 3 years ago

We could use sinon with a fake (like this one). We might have to setup the window.chrome object as the fake everything uses. We also might need to use sinon fakes or spies for that as well. This would be something we do after we integrate to a monorepo. (#81) Scripts and the overarching chrome extension could have their own local unit tests run from their build folders.

This issue will be idle until #81 is done, and then we'll start working on unit tests.

nicolas377 commented 2 years ago

We're actually going to try to grind out 3.3.0, and then we'll PR in infrastructure for unit tests, along with some basic tests for the extension. Gradually, we can add unit tests for scripts, so this will be a more long-term improvement.

nicolas377 commented 2 years ago

https://medium.com/swlh/how-to-setting-up-unit-tests-with-typescript-871c0f4f1609

nicolas377 commented 2 years ago

https://www.freecodecamp.org/news/how-to-start-unit-testing-javascript/

nicolas377 commented 2 years ago

ts-sinon along with sinon-chrome should do the trick with regards to testing.