title: Jest test fails when environment is configured with webpack-hot-middleware
body: <p>So I'm running a very basic Jest test to test if one of my routes returns a 200.</p>
  
  <pre><code>import request from 'supertest';
  import app from './../app';
  
  describe('GET /', () =&gt; {
    it('should render properly', async () =&gt; {
      await request(app).get('/api/testing').expect(200);
    });
  });
  </code></pre>
  
  <p>This was working perfectly then I configured webpack-hot-middleware and it seems to break at line 2 where I import app.</p>
  
  <pre><code>TypeError: setInterval(...).unref is not a function
  
    at createEventStream (node_modules/webpack-hot-middleware/middleware.js:50:17)
    at webpackHotMiddleware (node_modules/webpack-hot-middleware/middleware.js:12:21)
    at Object.&lt;anonymous&gt; (server/app.js:62:73)
    at Object.&lt;anonymous&gt; (server/test/routes.test.js:2:38)
  </code></pre>
  
  <p>If I remove the following code from my app.js the tests all run fine.</p>
  
  <pre><code>  app.use(middleware);
    app.use(webpackHotMiddleware(compiler));
    app.get('*', (req, res) =&gt; {
      res.write(middleware.fileSystem.readFileSync(path.join(__dirname, '../dist/index.html')));
      res.end();
    });
  </code></pre>
  
  <p>Has anyone configured Jest for webpack-hot-middleware? I'm kind of lost because I feel like I've tried everything.</p>