I am testing a couple of components that go beyond their DOM structure when mounting and unmounting to provide certain interoperability that would otherwise be impossible.
I use Jest and default JSDOM initialization to create a browser-like environment in node. I could not find anything in the documentation to suggest that Jest reset the JSDOM after each test run, and there is no explicit documentation on how to do this manually if it is not.
My question is: is there a Jest reset JSDOM instance after each test, is the package or does it support one JSDOM instance in all test runs? If so, how can I control it?
source
share