Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 1018 Bytes

README.md

File metadata and controls

41 lines (29 loc) · 1018 Bytes

jest-enzyme

npm version License Circle CI

Installation

We suggest using yarn for installations.

yarn add jest-enzyme --dev

But npm works too!

$ npm install jest-enzyme --save-dev

Setup

The simplest setup is to use jest's setupTestFrameworkScriptFile config.

On older versions of Jest, you'll also need to tell jest to unmock react, enzyme, and jest-enzyme.

Make sure your package.json includes the following:

"jest": {
  "setupTestFrameworkScriptFile": "./node_modules/jest-enzyme/lib/index.js",

  // old versions of jest set the unmocks
  "unmockedModulePathPatterns": [
    "react",
    "enzyme",
    "jasmine-enzyme"
  ]
},