Jest test fails with “window is not defined”
I had the same issue and I do not believe modifying globals is the way to do it. The issue was because in my Jest configuration I had testEnvironment set to node when it should’ve been jsdom. For me, this setting was located in file package.json as defined by the React starter app.