title: Jest: ReferenceError: global is not defined
body: <p>So I am writing unit test using &quot;react-testing-library&quot; on Jest and I have this error:</p>
  <pre><code> Test suite failed to run
  
      ReferenceError: global is not defined
  
        at Object.&lt;anonymous&gt; (node_modules/@jest/core/node_modules/graceful-fs/graceful-fs.js:92:1)
        at Object.&lt;anonymous&gt; (node_modules/@jest/core/node_modules/expect/build/toThrowMatchers.js:10:24)
        at Object.&lt;anonymous&gt; (node_modules/@jest/core/node_modules/expect/build/index.js:35:48)
        at TestScheduler.scheduleTests (node_modules/@jest/core/build/TestScheduler.js:333:13)
        at runJest (node_modules/@jest/core/build/runJest.js:387:19)
        at _run10000 (node_modules/@jest/core/build/cli/index.js:408:7)
        at runCLI (node_modules/@jest/core/build/cli/index.js:261:3)
  </code></pre>