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 using jsdom-global in context with mocha tests, testing a react application.
The test infrastructure is built around integration tests, using enzyme's mount method. I noticed, that react is using the DOM as storage place for internal logic. This is causing side-effects between the tests which are impossible to debug. I would like to freshly setup the DOM before every test runs.
Do you have an idea, how to reset the jsdom/jsdom-global at runtime between tests? Using the mocha hooks did not work. It seems that once babel-register is activated to compile test and source, jsdom-global stops working. In other words, how can jsdom-global be used after babel-register has compiled the code?
I appreciate any input.
The text was updated successfully, but these errors were encountered:
I'm using jsdom-global in context with mocha tests, testing a react application.
The test infrastructure is built around integration tests, using enzyme's
mount
method. I noticed, that react is using the DOM as storage place for internal logic. This is causing side-effects between the tests which are impossible to debug. I would like to freshly setup the DOM before every test runs.Do you have an idea, how to reset the jsdom/jsdom-global at runtime between tests? Using the mocha hooks did not work. It seems that once babel-register is activated to compile test and source, jsdom-global stops working. In other words, how can jsdom-global be used after babel-register has compiled the code?
I appreciate any input.
The text was updated successfully, but these errors were encountered: