react testingPosted: June 21, 2017
I have to say that hardest part with react was to figure out testing. (testing components is easy with thousands examples). But how to test props, state vlaues, clicking events, helping functions,… There are many projects in github and almost all of them are without any tests.
I have put together small app, where you can find code with tests.
I have tested:
* props values
* state values
* events on components like clicking,…
Frankly I haven’t seen any project where they would cover all of the above.
I am not gonna write step by step, just small info I am using Jest & Enzyme testing framework.
For details better check my code. Check for package.json for packages I am using and __tests__ folders for tests.