title: ReferenceError: Response is not defined
body: <p><strong>Short Version:</strong></p>
  
  <p>I am writing a test case for my Vue component using <code>vue-test-utils</code> and  <code>jest</code>.</p>
  
  <p>I am trying to create a <code>Response</code> object in one of my test cases, but I keep getting error 
  <code>ReferenceError: Response is not defined</code></p>
  
  <p><strong>Long Version</strong></p>
  
  <p>I am trying to mock an API response when a Vuex action is dispatched using jest.
  I have created a Vuex action like this</p>
  
  <pre><code>let fakeAccountList = [
    {"id":"abcd","title":"Random Account 1"},
    {"id":"pqrs","title":"Random Account 2"}
  ]
  actions = {
     getAccounts: jest.fn(()=&gt;{
  
       return new Promise((resolve, reject)=&gt;{
         resolve(mockResponse(200,'ok',fakeAccountList))
        })
      })
   }
  </code></pre>
  
  <p>The <code>getAccounts</code> action returns a Promise which resolves to a list of accounts. The <code>mockResponse</code> function is as shown:</p>
  
  <pre><code>mockResponse = (status, statusText, response) =&gt; {
  
    return new Response(response, {
      status: status,
      statusText: statusText,
      headers: {
        'Content-type': 'application/json'
      }
    });
  };
  </code></pre>
  
  <p>When <code>mockResponse</code> is called, I get the error <code>ReferenceError: Response is not defined</code></p>
  
  <p>I found this very old issue:
  <a href="https://github.com/facebook/jest/issues/930" rel="noreferrer">https://github.com/facebook/jest/issues/930</a>
  The comments suggest that it was fixed,but, it is not working for me. I do not want to import extra libraries such as <code>isomorphic-fetch</code> just for this.</p>
  
  <p>Here is my <code>devDependencies</code> in <code>package.json</code>:</p>
  
  <pre><code>"devDependencies": {
      "@vue/cli-plugin-babel": "3.0.3",
      "@vue/cli-plugin-e2e-cypress": "3.0.3",
      "@vue/cli-plugin-eslint": "3.0.3",
      "@vue/cli-plugin-unit-jest": "3.0.3",
      "@vue/cli-service": "3.0.3",
      "@vue/test-utils": "1.0.0-beta.25",
      "babel-core": "7.0.0-bridge.0",
      "babel-jest": "23.6.0",
      "less": "3.0.4",
      "less-loader": "4.1.0",
      "lodash": "4.17.10",
      "node-sass": "4.9.2",
      "sass-loader": "7.0.3",
      "vue-template-compiler": "2.5.16",
    }
  </code></pre>
  
  <p>Any help would be appreciated. Thanks in advance</p>