question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[test] Migrate tests from enzyme to react-testing-library

See original GitHub issue

15 months ago, we have introduced react-testing-library in the codebase: #15732. Since, then, we have been progressively migrating the tests from enzyme to react-testing-library. This was done as a background task, so far. Especially when we were migrating a component from class names to hooks or when we needed to fix a bug.

However, we have seen community members interested in helping with this effort, e.g. @baterson in #22441, @marcosvega91 in #20914, @emilyuhde in #17942, or @eladmotola in #22906.

I have opened this issue so we can keep track of the tests that are left to be migrated and avoid conflicts:

Integration

  • test/integration/Menu.test.js
  • test/integration/MenuList.test.js
  • test/integration/NestedMenu.test.js
  • test/integration/Select.test.js
  • test/integration/TableCell.test.js (#23095)
  • test/integration/TableRow.test.js (#23105)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:31 (26 by maintainers)

github_iconTop GitHub Comments

5reactions
oliviertassinaricommented, Oct 10, 2020

Last month, react-testing-library had more downloads than enzyme in the ecosystem!

1reaction
eps1loncommented, Jun 19, 2021

Still have tests using createMount

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrating from Enzyme to React Testing Library - Medium
Enzyme and React Testing Library (RTL) are packages which provide utilities to enhance unit tests for React components. Enzyme has been popular for...
Read more >
Migrating from Enzyme to React Testing Library
Technique #1: Snapshot tests with RTL ... .toJSON();. expect(letter).toMatchSnapshot();. }); }); Basically you take the rendered tree, convert it ...
Read more >
Replacing Enzyme with React Testing Library
We can call the test we wrote with React Testing Library an integration test. We verify if the Counter component works well with...
Read more >
My experience migrating from enzyme to react testing library
Migrate right away all tests using mount , as those are the ones behaving differently. New tests should be written directly with react...
Read more >
react-testing-library vs. Enzyme - LogRocket Blog
To migrate tests from react-testing-library to Enzyme, you'll need to install an additional library called enzyme-adapter-react-[react-version] ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found