Skip to content

Commit

Permalink
Testing: Remove enzyme completely (#44494)
Browse files Browse the repository at this point in the history
* Remove enzyme completely

* Add CHANGELOG entry

* Document how to use enzyme

* Link from CHANGELOG to README

* Clarify relationship between RTL and React 18 as rationale for removing enzyme

* Remove underscore usage completely
  • Loading branch information
tyxla authored Sep 28, 2022
1 parent 44731b9 commit c66d2ce
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 915 deletions.
2 changes: 1 addition & 1 deletion docs/contributors/code/testing-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ When writing tests consider the following:

Tests for JavaScript use [Jest](https://jestjs.io/) as the test runner and its API for [globals](https://jestjs.io/docs/en/api.html) (`describe`, `test`, `beforeEach` and so on) [assertions](https://jestjs.io/docs/en/expect.html), [mocks](https://jestjs.io/docs/en/mock-functions.html), [spies](https://jestjs.io/docs/en/jest-object.html#jestspyonobject-methodname) and [mock functions](https://jestjs.io/docs/en/mock-function-api.html). If needed, you can also use [React Testing Library](https://testing-library.com/docs/react-testing-library/intro) for React component testing.

_It should be noted that in the past, React components were unit tested with [Enzyme](https://github.com/airbnb/enzyme). However, React Testing Library (RTL) should be used for new tests instead, and over time old tests should be refactored to use RTL too (typically when working on code that touches an old test)._
_It should be noted that in the past, React components were unit tested with [Enzyme](https://github.com/airbnb/enzyme). However, React Testing Library (RTL) is now used for all existing and new tests instead._

Assuming you've followed the [instructions](/docs/contributors/code/getting-started-with-code-contribution.md) to install Node and project dependencies, tests can be run from the command-line with NPM:

Expand Down
Loading

0 comments on commit c66d2ce

Please sign in to comment.