Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesnt work for React 16+ #107

Open
binarybaba opened this issue Jun 16, 2018 · 0 comments
Open

Doesnt work for React 16+ #107

binarybaba opened this issue Jun 16, 2018 · 0 comments

Comments

@binarybaba
Copy link

"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..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant