title: Jest has detected the following 1 open handle potentially keeping Jest from exiting
body: <p>Here are my HTTP  routes </p>
  
  <pre><code> app.get('/', (req, res) =&gt; {
      res.status(200).send('Hello World!')
  })
  
  app.post('/sample', (req, res) =&gt; {
      res.status(200).json({
          x:1,y:2
      });
  })
  </code></pre>
  
  <p>I would like to test for the following</p>
  
  <p>1) <code>GET</code> request working fine.</p>
  
  <p>2)the  <code>/sample</code> response contains the properties and <code>x</code> and <code>y</code></p>
  
  <pre><code>const request = require('supertest');
  const app = require('../app');
  
  describe('Test the root path', () =&gt; {
      test('It should response the GET method', () =&gt; {
          return request(app).get('/').expect(200);
      });
  })
  
  describe('Test the post path', () =&gt; {
      test('It should response the POST method', (done) =&gt; {
          return request(app).post('/sample').expect(200).end(err,data=&gt;{
              expect(data.body.x).toEqual('1');
  
          });
      });
  })
  </code></pre>
  
  <p>But I got the following error on running the test</p>
  
  <blockquote>
    <p>Jest has detected the following 1 open handle potentially keeping Jest
    from exiting:</p>
    
    <p>return request(app).get('/').expect(200);</p>
  </blockquote>