title: ReferenceError: document is not defined Jest React Testing Library
body: <p>I am publishing a react component to npm package, I added Webpack, babel, linting, and test to it, initially Webpack builds successfully, tests were running successfully, but then I added linting and remove node_modules folder and then install again using npm install to verify everything, at this point test breaks, Initially  I got jest not found error which I fixed by npm install jest, after that, got " ReferenceError: it is not defined", fixed by import { describe, expect, it } from "@jest/globals";, now getting " ReferenceError: document is not defined", tried multiple solutions like setting the "testEnvironment": "jsdom", tried to set global.document, but nothing is working, you can see the complete code at</p>
  
  <p><a href="https://github.com/asifsha/react-picker-cascader" rel="nofollow noreferrer">https://github.com/asifsha/react-picker-cascader</a></p>
  
  <p><a href="https://i.stack.imgur.com/xGr9R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xGr9R.png" alt="enter image description here"></a></p>