IFS49F / poker

:spades: Vivid, registration-free, easy-to-use scrum poker. Aka Poker4Fun.

Home Page:https://poker4.fun

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tests for React components

just4fun opened this issue · comments

commented

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.

commented

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()
commented

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

commented

API differences between render and mount/shallow.

enzymejs/enzyme#465 (comment)