react testing

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:
* components
* props values
* state values
* events on components like clicking,…
* functions

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.

Here are:
* github link
* travis link
* sonarcloud.io link

enjoy

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s