Camilo icon indicating copy to clipboard operation
Camilo copied to clipboard

Add unit testing

Open eduardogr opened this issue 5 years ago • 7 comments

It would be nice to add unit tests to ensure quality for Camilo logic

eduardogr avatar Oct 04 '19 14:10 eduardogr

I'd try this, do you have a preference for testing framework? Is jest fine? And can you point me which file has heaviest logic and should be first to focus on? I wasn't checking details yet, so I'm not sure where to start.

ra100 avatar Oct 04 '19 17:10 ra100

i'd like this to be done via skmp-test, What do you think?

  • https://github.com/skpm/skpm/tree/master/packages/test-runner

main logic are place in switch-library and switch-selection files and replace* ones that are used by them, those files are good candidates to test

eduardogr avatar Oct 04 '19 18:10 eduardogr

oh, sure, skmp-test makes sense, since skmp is used for build so it has much more suitable toolkit

ra100 avatar Oct 04 '19 18:10 ra100

And actually, looks like skmp-test is using jest in the background :)

ra100 avatar Oct 04 '19 19:10 ra100

yes, it is :)

So, what do you think? feel free to unit test all of this, and fill the script npm run test that now is just failing

eduardogr avatar Oct 05 '19 11:10 eduardogr

ok, I'll start working on it

ra100 avatar Oct 05 '19 12:10 ra100

I'm sorry, I did what I could, and it looks more complicated, to be able to test it properly. Loading document, loading libraries and checking that everything what should has been changed. Here is just a simple setup to have the test configuration ready.

ra100 avatar Oct 05 '19 16:10 ra100