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
When configuring chai-enzyme globally I have failing tests, but if I add the following to the file with the failing tests it works:
import chai from 'chai'
import chaiEnzyme from 'chai-enzyme'
chai.use(chaiEnzyme())
Global chai-enzyme config
Importing chai-enzyme as a CommonJs module and configuring it globally works fine, but the ES6 style import causes tests to fail.
import chaiEnzymeEs6 from 'chai-enzyme' // Doesn't work
const chaiEnzyme = require('chai-enzyme') // Works fine
logging the export of each of these shows that chaiEnzymeEs6 === chaiEnzyme
Also, test fails in the same way when chai-enzyme is imported before stubbing the global window and document using js-dom.
Errors on failing tests
The errors I get in tests that are submitting a reduxForm, each failing due to some (related?) issue:
Invariant Violation: findComponentRoot(..., .10vfrs14k8w.1.1.1.0.1): Unable to find element. This probably means the DOM was unexpectedly mutated (e.g., by the browser), usually due to forgetting a <tbody> when using tables, nesting tags like <form>, <p>, or <a>, or using non-SVG elements in an <svg> parent. Try inspecting the child nodes of the element with React ID ``.
Invariant Violation: processUpdates(): Unable to find child 1 of element. This probably means the DOM was unexpectedly mutated (e.g., by the browser), usually due to forgetting a <tbody> when using tables, nesting tags like <form>, <p>, or <a>, or using non-SVG elements in an <svg> parent. Try inspecting the child nodes of the element with React ID `.10vfrs14k8w.1.1.0.0`.
Invariant Violation: dangerouslyRenderMarkup(...): 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 have little knowledge about the internals of require vs ES6 imports, but something weird is going on there. Maybe someone else has some more insight.
The text was updated successfully, but these errors were encountered:
Local chai-enzyme config
When configuring
chai-enzyme
globally I have failing tests, but if I add the following to the file with the failing tests it works:Global chai-enzyme config
Importing
chai-enzyme
as a CommonJs module and configuring it globally works fine, but the ES6 style import causes tests to fail.logging the export of each of these shows that
chaiEnzymeEs6 === chaiEnzyme
Also, test fails in the same way when
chai-enzyme
is imported before stubbing the global window and document using js-dom.Errors on failing tests
The errors I get in tests that are submitting a reduxForm, each failing due to some (related?) issue:
I have little knowledge about the internals of require vs ES6 imports, but something weird is going on there. Maybe someone else has some more insight.
The text was updated successfully, but these errors were encountered: