Skip to content

Download [portable] Enzyme May 2026

In this guide, we’ll walk you through how to , set it up with different test runners, and ensure it plays nicely with your version of React. What is Enzyme?

import Enzyme from 'enzyme'; import Adapter from '@wojtekmaj/enzyme-adapter-react-17'; // Use the version you downloaded Enzyme.configure({ adapter: new Adapter() }); Use code with caution.

To make sure everything is working, create a simple test file (e.g., App.test.js ) and try a shallow render: javascript download enzyme

npm install --save-dev enzyme-adapter-react-16

Enzyme is distributed as an npm package. To add it to your project, open your terminal in your project root and run one of the following commands: npm install --save-dev enzyme Use code with caution. Using yarn: yarn add --dev enzyme Use code with caution. Step 3: Downloading the Correct Adapter In this guide, we’ll walk you through how

(Jest is the most common companion for Enzyme) Step 2: Download Enzyme via NPM or Yarn

If you are using , make sure your package.json points to this setup file: To make sure everything is working, create a

Once you’ve downloaded the packages, you need to tell Enzyme which adapter to use. It’s best practice to do this in a setupTests.js file. javascript