typpo / spacekit

Javascript library for 3D space visualizations
https://typpo.github.io/spacekit/
MIT License
527 stars 39 forks source link

Add testing infrastructure #28

Closed HankG closed 4 years ago

HankG commented 4 years ago

What does the pull request do?

Adds the Jest unit test framework to Spacekit so can have unit tests against components

What is the current behavior?

No unit test system for running regressions, etc.

How was the solution implemented (if it's not obvious)?

Brought in the Jest testing framework, compatible with Jasmine. Using the Babel plugin for Jest so that we can use ES6 style module imports for the tests as well. Created two example tests for simple illustration of usage.

HankG commented 4 years ago

I don't know how to configure Codacy to correctly parse the test units. It's complain about the auto-generated config file (but I think that'll just be the one time). It's complaining about "describe" and "test" not being defined and it's flagging some numerical literals which probably should be fine. Since future tests would have those I'd like to figure out how to properly configure this to work if possible.Anyone have any ideas?

typpo commented 4 years ago

Thanks Hank, this looks great to me. I've actually disabled codacy for future PRs, this was an old configuration and I don't find that it adds much. Time for me to write some tests :)