Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve example existing tests #1847

Closed
yanivefraim opened this issue Jul 15, 2016 · 1 comment
Closed

Improve example existing tests #1847

yanivefraim opened this issue Jul 15, 2016 · 1 comment

Comments

@yanivefraim
Copy link

The examples currently have tests for components and reducers, but it does not have any integration tests, meaning we do not test that the different components / reducers are "wired" together. So, for example, if taking the counter example, I can change INCREMENT reducer and change it to be MY_INCREMENT, in production code and in reducer's test. My application is now broken, but all tests are green. I can even completely delete on reducer with its test and all tests are still green.

I think that those examples are really critical for a library as important as Redux (many people rely on it as an example of best practices).

I would expect to have proper examples with proper tests!

If we go back to the example that I showed before (counter example), I would expect to have a test that clicks an increment/decrement button and checks that ui is updated accordingly.

Another example of a problem in tests can be found here. I can (for example) completely remove this line, and tests will still be green... We have to test the main component as well!

And last thing - we still have a lot of examples missing tests / having partial tests. I see that we have a lot of volunteers to help with tests but it seems to get stuck somewhere. Real world example does not have tests, Todos example only test reducers and actions and so on...

I would love to help here with my experience in tests and would love to here what you have to say about that!

@timdorr
Copy link
Member

timdorr commented Sep 19, 2016

I'd love to see a PR for this. We had some example updates going on in #1800 and we want to switch to using enzyme (#1481) and Jest (#1944). This should enable some more substantial testing of the example apps, which would be great to add.

@timdorr timdorr closed this as completed Sep 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants