I\'m attempting to test a React component with Jest/Enzyme while using Webpack.
I have a very simple test @
import React from \'react\';
import { sha
As I see, this error arises in many cases and requires different approaches to solve it. My scenario is not the same as the example above, I use redux & router, although I was struggling with the same error. What helped me to solve this problem is to change index.js
from:
ReactDOM.render(
,
document.getElementById("root")
);
registerServiceWorker();
to:
ReactDOM.render(
(
),
document.getElementById('root') || document.createElement('div') // for testing purposes
);
registerServiceWorker();