title: Jest URL.createObjectURL is not a function
body: <p>I'm developping a reactJs application. I'm using jest to test my application.
  I want to test a function that download a blob.</p>
  
  <p>But unfortunately I receve this error:</p>
  
  <blockquote>
    <p>URL.createObjectURL is not a function</p>
  </blockquote>
  
  <p>my test function:</p>
  
  <pre><code>describe('download', () =&gt; {
      const documentIntial = { content: 'aaa' };
      it('msSaveOrOpenBlob should not have been called when navigao is undefined', () =&gt; {
        window.navigator.msSaveOrOpenBlob = null;
        download(documentIntial);
        expect(window.navigator.msSaveOrOpenBlob).toHaveBeenCalledTimes(0);
      });
    });
  </code></pre>
  
  <p>The function I want to test:</p>
  
  <pre><code>export const download = document =&gt; {
    const blob = new Blob([base64ToArrayBuffer(document.content)], {
      type: 'application/pdf',
    });
    if (window.navigator &amp;&amp; window.navigator.msSaveOrOpenBlob) {
      window.navigator.msSaveOrOpenBlob(blob);
      return;
    }
  
    const fileURL = URL.createObjectURL(blob);
    window.open(fileURL);
  };
  </code></pre>