We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, i'm testing a component with mount:
when I try to create the wrapper
import React from 'react'; import { mount } from 'enzyme'; import { Provider } from 'react-redux'; import configureStore from 'redux-mock-store'; import thunk from 'redux-thunk'; const middlewares = [ thunk ]; const mockStore = configureStore( middlewares ); const initState = {}; const store = mockStore( initState ); store.dispatch = jest.fn(); const wrapper = mount( <Provider store={ store } > <DeleteEventFab /> </Provider> )
throws this error
TypeError: Cannot read property 'child' of undefined 25 | 26 | > 27 | const wrapper = mount( | ^ 28 | <Provider store={ store } > 29 | <DeleteEventFab /> 30 | </Provider> at getFiber (node_modules/enzyme-adapter-react-16/src/detectFiberTags.js:15:35) at detectFiberTags (node_modules/enzyme-adapter-react-16/src/detectFiberTags.js:76:15) at ReactSixteenAdapter.createMountRenderer (node_modules/enzyme-adapter-react-16/src/ReactSixteenAdapter.js:465:19) at ReactSixteenAdapter.createRenderer (node_modules/enzyme-adapter-react-16/src/ReactSixteenAdapter.js:820:51) at new ReactWrapper (node_modules/enzyme/src/ReactWrapper.js:113:32) at mount (node_modules/enzyme/src/mount.js:10:10) at Object.<anonymous> (src/tests/components/DeleteEventFab.test.js:27:17)
If I downgrade react to version "react": "^16.13.1", "react-dom": "^16.13.1"
this same code works perfect
It should create the wrapper son I can make an expect( wrapper ).toMatchSnapshot();
"react": "^17.0.1", "react-dom": "^17.0.1", "enzyme": "^3.11.0", "enzyme-adapter-react-16": "^1.15.5", "enzyme-to-json": "^3.6.1",
The text was updated successfully, but these errors were encountered:
enzyme is not yet compatible with React 17 - you're using the React 16 adapter, and that requires react 16.
See #2429 for that support.
Sorry, something went wrong.
No branches or pull requests
Hi, i'm testing a component with mount:
Current behavior
when I try to create the wrapper
throws this error
If I downgrade react to version
"react": "^16.13.1",
"react-dom": "^16.13.1"
this same code works perfect
Expected behavior
It should create the wrapper son I can make an expect( wrapper ).toMatchSnapshot();
Your environment
API
Version
Adapter
The text was updated successfully, but these errors were encountered: