You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enzyme Internal Error: Enzyme expects an adapter to be configured, but found none.
To configure an adapter, you should call `Enzyme.configure({ adapter: new Adapter() })`
before using any of Enzyme's top level APIs, where `Adapter` is the adapter
corresponding to the library currently being tested. For example:
import Adapter from 'enzyme-adapter-react-15';
To find out more about this, see http://airbnb.io/enzyme/docs/installation/index.html
For me, wrappers created by render worked fine with the serializer, but ones created by mount and shallow gave the above error. In all cases, using the toJson method directly worked as expected.
Error
Libraries Versions
How to reproduce?
This is a quite clean repro-case with only the essential parts.
https://gist.github.com/Ranguro/a14b6b8e6868ff508b80f29df8a99971
I believe the problem is linked to this specific line in my package.json
When I add this line - the Enzyme Internal Error is being thrown. If I remove it and instead- run the following, it doesn't throw the error:
https://gist.github.com/Ranguro/f318b60054f415fd2a418900c2562742
See how I added toJson from enzyme-to-json there and the test passes.
This is my setupTests.js for the enzyme adapter.
This is how I setup my setupTests.js
Other Comments
I tried throw new Error('fail') to check if the configurations was being run when running tests and it showed the output well.
The text was updated successfully, but these errors were encountered: