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

Tests for React components #47

Closed
just4fun opened this issue Sep 23, 2017 · 3 comments · Fixed by #48
Closed

Tests for React components #47

just4fun opened this issue Sep 23, 2017 · 3 comments · Fixed by #48
Assignees

Comments

@just4fun
Copy link
Member

Jest has been introduced with create-react-app together, I also found Jest has some advantages than Mocha, such as Jest has snapshot testing, and the execution performance for tests is better than Mocha.

So I'd like to create this issue here to note my investigation result, maybe some article links.

@just4fun just4fun self-assigned this Sep 23, 2017
@just4fun
Copy link
Member Author

First of all, I'd like to use Jest with Enzyme together, which is always used to test React components.

The next step is to investigate how to use the three different kinds of render approaches in Enzyme.

  • shallow()
  • mount()
  • render()

@just4fun
Copy link
Member Author

https://www.codementor.io/vijayst/unit-testing-react-components-jest-or-enzyme-du1087lh8

Best article I found which show you how to use Jest and Enzyme together to test React components instead of comparing the two.

See here for new created tests: https://github.com/IFS49F/poker/compare/unit-testing

@just4fun
Copy link
Member Author

API differences between render and mount/shallow.

enzymejs/enzyme#465 (comment)

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

Successfully merging a pull request may close this issue.

1 participant