Pausansol / Camilo

Sketch plugin specially crafted to work in Design systems with multiple themes
MIT License
188 stars 18 forks source link

Add unit testing #21

Open eduardogr opened 5 years ago

eduardogr commented 5 years ago

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

ra100 commented 5 years ago

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.

eduardogr commented 5 years ago

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

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

ra100 commented 5 years ago

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

ra100 commented 5 years ago

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

eduardogr commented 5 years ago

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

ra100 commented 5 years ago

ok, I'll start working on it

ra100 commented 5 years ago

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.