Skip to content

Drop and remove enzyme in favour of React Testing Utils or lightweight wrapper lib #17249

@getdave

Description

@getdave

We currently use enzyme for a lot of our tests. However, it is not keeping pace with the developments in the React and encourages poor testing practices.

We should be focusing on making tests resemble the way Gutenberg is used by users. Unfortunately, Enzyme's APIs encourage/enable "poor" testing practices such as testing component implementation details and shallow rendering which doesn't provide confidence that your "feature" works when all the components are wired together.

Describe the solution you'd like

  • An official announcement formally moving away from Enzyme to either

  • Updating documentation to

  • Incrementally converting all the existing Enzyme based tests over to the new testing solution - this does not have to be done in a single hit and we could document the key tests to target for migration and leave the others to be migrated "as and when".

Metadata

Metadata

Assignees

Labels

[Status] In ProgressTracking issues with work in progress[Tool] WP Scripts/packages/scripts[Type] Automated TestingTesting infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.[Type] Tracking IssueTactical breakdown of efforts across the codebase and/or tied to Overview issues.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions