ISSUE - Writing Tests for React Applications Using Jest and Enzyme

Enzyme doesn’t support React 18.

The lesson for testing react has us installing enzyme for our lesson when we should be using React Testing Library.

4 Likes

I just ran into this myself. I also found this article entitled, “Enzyme is dead”.

It appears that Enzyme does not support React v17 or v18. It stopped being maintained after v16. It appears we should be using the “React Testing Library” instead. This link states that it is a replacement for Enzyme and also works with Jest. (React Testing Library | Testing Library)

Hopefully the React course here on Codecademy gets updated to switch over.

3 Likes

Front-Eng Career Path still talks about Enzyme and uses an outdated Router. Due to this, we’re learning history instead of things being used now.

2 Likes

Just posted this in another thread as follows:

If anyone else is just reaching this section and just discovered that Enzyme is no longer used and you get ERR! when trying to install locally, CC has a separate course on Learn React Testing with Jest and React Testing Library!

You basically skip through the rest of the lessons on the Front End/Full Stack course!

4 Likes

Yes, these issues with the Enzyme-related section of the Full Stack course haven’t been addressed as of August 2024.

I tried following a course-recommended article on React testing only to find the practice project returning errors. Enzyme died, and it seems Codecademy have been slow to pick up on the fact.