Skip to content

Doesnt work for React 16+ #107

@binarybaba

Description

@binarybaba

"jest-serializer-enzyme"

If you are going to use React 16,
Replace jest-serializer-enzyme to enzyme-to-json/serializer and include enzyme-to-json as a dev dependency.

For enzyme to work with React 16, you need to yarn add enzyme-adapter-react-16 -D

And then, inside your tests,

import { shallow, configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
beforeAll(() => {
    configure({
        adapter: new Adapter()
    });
});
// your tests here..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions