title: Integration testing with Nuxt and Jest
body: <p>I wish to render a page using Nuxt's <code>renderAndGetWindow</code> in order to test the values returned by my API.</p>
  
  <p>Here's how I do it:</p>
  
  <pre><code>// Nuxt instance
  let nuxt = null;
  // Our page to test
  let homePage = null;
  
  beforeAll(async (done) =&gt; {
      // Configuration
      const rootDir = resolve(__dirname, '../..');
      let config = {};
      config = require(resolve(rootDir, 'nuxt.config.js'));
      config.rootDir = rootDir; // project folder
      config.env.isDev = false; // dev build
      config.mode = 'universal'; // Isomorphic application
  
      nuxt = new Nuxt(config);
      await new Builder(nuxt).build();
      nuxt.listen(3001, 'localhost');
      homePage = await nuxt.renderAndGetWindow('http://localhost:3001/');
    });
  </code></pre>
  
  <p>Which gives me 2 distinct errors:</p>
  
  <blockquote>
    <p>console.error node_modules/jest-jasmine2/build/jasmine/Env.js:157
        Unhandled error</p>
    
    <p>console.error node_modules/jest-jasmine2/build/jasmine/Env.js:158
        TypeError: setInterval(...).unref is not a function</p>
  </blockquote>
  
  <p>And</p>
  
  <blockquote>
    <p>Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.</p>
  
  <pre><code> at mapper (node_modules/jest-jasmine2/build/queue_runner.js:41:52)
  </code></pre>
  </blockquote>
  
  <p>I get this ever since I switched from Ava to Jest.</p>
  
  <p>Am I handling my rendering wrong?</p>