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
I'm trying to add chai-enzyme. When I add import ChaiEnzyme from 'chai-enzyme' several tests are failing with an error:
Invariant Violation: dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a worker thread. Make sure `window` and `document` are available globally before requiring React when unit testing or use ReactDOMServer.renderToString() for server rendering.
I was able to fix it, by making sure that chai-enzymeimported and initiated after jsdom.
The text was updated successfully, but these errors were encountered:
Hard for me to figure this out, since I have already cha-enzyme in my unittesting initialization code. With chai-enzyme imported before jsdom, React component cannot render different type of root element in re-render with the dangerouslyReplaceNodeWithMarkup error message.
Hello.
I'm trying to add
chai-enzyme
. When I addimport ChaiEnzyme from 'chai-enzyme'
several tests are failing with an error:I was able to fix it, by making sure that
chai-enzyme
imported and initiated afterjsdom
.The text was updated successfully, but these errors were encountered: