I might know the answer to this question but still want to clear some doubts. jest runs tests in a Node.js like runtime which has no definition for the global window object and specifying the jest test environment to jest-environment-jsdom only includes the jest specific jsdom module that has custom definitions for the various functions defined in the global window object as per standard specifications to run in a Node.js like runtime. The underlying runtime doesn't change but rather some API definitions are added. Is this correct? If not then how does the jsdom environment for jest actually work?