Skip to content

Instantly share code, notes, and snippets.

@janhesters
Created September 26, 2020 12:45
Show Gist options
  • Save janhesters/ec2e6bee27e1e64d1b80d3f8016a5044 to your computer and use it in GitHub Desktop.
Save janhesters/ec2e6bee27e1e64d1b80d3f8016a5044 to your computer and use it in GitHub Desktop.
Pros and cons of RITEway, RTL and E2E tests.
Tool Pros Cons
RITEway - runs the fastest (basically instant after Babel compiled)
- good for pure components (map props to JSX)
- good for other unit tests (reducers, sagas, other pure functions etc.)
- No way to do user interactions
- jQuery selectors
Testing Library - faster than E2E tests
- ability to simulate user interactions
- implementation independent selectors
- lower confidence than E2E tests
- can lead to mocking hell (used wrongly)
E2E - actual API requests
- no / few mocks
- UI actually rendered in browser
- ability to test cross browser functionality
- slow
- sometimes flaky
- difficult to write well (e.g. isolated, parallelized)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment