StackOverflow - StackOverflow
Why does shallow Rendering not work as expected?
I have the same problem. It solved by using the below .
I have created a jest.config.js
file at the root level and add below code.
module.export ={
setupFiles:[ '<rootDir>/src/setUpTests.js']
}
I have created setUpTests.js
file and add below code.
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
configure({ adapter: new Adapter() });
And solved my problem.
Was this helpful?
Related Articles
Have a different question?
Can't find the answer you're looking for? Submit your own question to our community.
🛎️ Get Weekly OTA Fixes
New answers, vendor issues, and updates — straight to your inbox.