Closed ashleyyy94 closed 5 months ago
did you try const Adapter = require('@cfaester/enzyme-adapter-react-18')
?
Looks like const Adapter = require('@cfaester/enzyme-adapter-react-18');
will give you:
[console log] Adapter { default: [class ReactEighteenAdapter extends EnzymeAdapter] }
We can access the default
property inside that object instead via:
const Adapter = require('@cfaester/enzyme-adapter-react-18').default;
Seems resolved.
I am trying to configure the Enzyme adapter using the below in my
jest.setup.js
:const { configure } = require('enzyme'); const { Adapter } = require('@cfaester/enzyme-adapter-react-18'); configure({ adapter: new Adapter() });
However, when I run my test files, it is throwing a typerror as below:
Any advice?
Thank you.