Skip to content
This repository was archived by the owner on Mar 5, 2022. It is now read-only.

Commit 53046a7

Browse files
committed
update Jest vs cypress-react-unit-test table in the README
1 parent fd67ac7 commit 53046a7

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,32 @@
44
55
## TLDR
66

7-
- What is this? This package allows you to use [Cypress](https://www.cypress.io/) test runner to unit test your React components with zero effort.
7+
- What is this? This package allows you to use [Cypress](https://www.cypress.io/) test runner to unit test your React components with zero effort. Here is a typical component testing, notice there is not external URL shown, since it is mounting the component directly.
88

99
![Example component test](images/dynamic.gif)
1010

1111
- How is this different from [Enzyme](https://github.com/airbnb/enzyme) or [RTL](https://testing-library.com/docs/react-testing-library/intro)? It is similar in functionality BUT runs the component in the real browser with full power of Cypress E2E test runner: [live GUI, full API, screen recording, CI support, cross-platform](https://www.cypress.io/features/), and [visual testing](https://on.cypress.io/visual-testing). Ohh, and the code coverage is built-in!
1212
- If you like using `@testing-library/react`, you can use `@testing-library/cypress` for the same `findBy`, `queryBy` commands, see one of the examples in the list below
1313

14+
## Comparison
15+
16+
<!-- prettier-ignore-start -->
17+
Feature | Jest / Enzyme / RTL | Cypress + `cypress-react-unit-test`
18+
--- | --- | ---
19+
Test runs in real browser | ❌ | ✅
20+
Uses full mount | ❌ | ✅
21+
Test speed | 🏎 | as fast as the app works in the browser
22+
Test can use additional plugins | maybe | use any [Cypress plugin](https://on.cypress.io/plugins)
23+
Test can interact with component | synthetic limited API | use any [Cypress command](https://on.cypress.io/api)
24+
Test can be debugged | via terminal and Node debugger | use browser DevTools
25+
Built-in time traveling debugger | ❌ | Cypress time traveling debugger
26+
Re-run tests on file or test change | ✅ | ✅
27+
Tests can be run in parallel | ✅ | ✅ via [parallelization](https://on.cypress.io/parallelization)
28+
Test against interface | if using `@testing-library/react` | ✅ and can use `@testing-library/cypress`
29+
Spying and mocking | Jest mocks | Sinon library
30+
Code coverage | ✅ | ✅
31+
<!-- prettier-ignore-end -->
32+
1433
## Known problems
1534

1635
See issues labeled [v2](https://github.com/bahmutov/cypress-react-unit-test/labels/v2)

0 commit comments

Comments
 (0)