- Why testing ?
- Let's create a simple test asserter
- Install Jest
- Test JS
- Why react changed the idea of test
- Install Enzyme
- Configure Enzyme
- Go over how to check for number of elements and stuff like that with enzyme
- Check state and props with enzyme
- Snapshot testing and the difference between shallow, mount and render
- Snapshot testing
Create a simple test asserter:
Test JS:
- https://codesandbox.io/s/qlvm92z92j
- https://codesandbox.io/s/9zyn84lomp
- Exercise: https://codesandbox.io/s/z3w1k7nx94
- Exercise end: https://codesandbox.io/s/jj4wlm28k9
Test React:
- https://codesandbox.io/s/v3vnn457ol
- https://codesandbox.io/s/jj3qm99n4v
- Exercise: https://codesandbox.io/s/7wk640x9zq
- Exercise end: https://codesandbox.io/s/82l240qm7l
Test react with state and simulate clicks: