I have a test that imports a component that in turn imports a helper file that uses the window object to pull out a query string parameter. I get the following erro
window
Here you can find examples of how to do this:
https://www.codementor.io/pkodmad/dom-testing-react-application-jest-k4ll4f8sd
For example:
import {jsdom} from 'jsdom'; const documentHTML = ''; global.document = jsdom(documentHTML); global.window = document.parentWindow;