3. Use Jest and React-Testing-Library to test React components#

3.1. Status#

Accepted

3.2. Context#

The Open edX community needs consistent tooling for testing React components.

3.3. Decision#

The Open edX community must use Jest and React-Testing-Library to test React components. We are deprecating the Enzyme library. New tests must not use Enzyme, and any repositories planning to move to React 18 or newer need to replace Enzyme.

3.4. Consequence#

The Open edX community must use Jest and React-Testing-Library to test React components.

3.5. Rejected Alternatives#

  1. Enzyme

    • Enzyme is dead.
      • Enzyme is not considered to be actively maintained anymore.

      • It does not support React hooks.

      • It does not and will not support React 18.

      • The community is unwilling to create an adapter for React 18.