Skip to content

jest-enzyme not working with create-react-app #293

Open
@sarneetk

Description

I have an app based on create-react-app. I imported jest-enzyme in my src/setupTests.js:

import { configure } from 'enzyme'
import Adapter from 'enzyme-adapter-react-16'

configure({adapter: new Adapter()})

import 'jest-enzyme'

when I run my tests, I am seeing the following error:

Test suite failed to run
    ReferenceError: expect is not defined
      7 | 
      at Object.<anonymous> (node_modules/jest-enzyme/lib/index.js:34:1)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions