title: Jest doesn't finish test on done() in callback
body: <p>I have two asynchronous tests, one of them runs well, and the second one fails to call async callback before timeout. Well, actually I suppose it DOES call the <code>done()</code> callback, but everything continues to work.</p>
  
  <p><strong>First</strong> (correct) is following:</p>
  
  <pre><code>    it('User should be verified', done =&gt; {
        const wsClient = require('socket.io-client')('http://localhost:7575/')
  
        function callback({ user, isNameTaken }) {
          expect(isNameTaken).toBe(false)
          expect(typeof user.id).toBe('string')
          expect(user.name).toBe('Sam')
          done()
        }
  
        wsClient.emit(VERIFY_USER, 'Sam', callback)
      })
  </code></pre>
  
  <p><strong>Second</strong> one (incorrect):</p>
  
  <pre><code> it('Do not allow duplicate nicknames', done =&gt; {
      const wsClient = require('socket.io-client')('http://localhost:7575/')
      function callbackFinal({ user, isNameTaken }) {
        console.log('============ CALLBACK B ===============', new Date())
        console.log({ user, isNameTaken })
        console.log({ done })
        try {
          expect(isNameTaken).toBe(true) // 4. Acutal test
          expect(user).toBe(null)
          done()
          console.log('============ CALLBACK B After done() ===============', new Date())
        } catch (e) {
          done(e)
        }          
      }
  
      function callback({ user, isNameTaken }) {
        console.log('============ CALLBACK A ===============', new Date())
        wsClient.emit(USER_CONNECTED, user) // 2. Add verified user to connected users list
        wsClient.emit(VERIFY_USER, 'Sam', callbackFinal) // 3. Try verifying user for the second time
      }
  
      wsClient.emit(VERIFY_USER, 'Sam', callback) // 1. Try verifying user for the first time
    })
  </code></pre>
  
  <p>Console output for the second test:</p>
  
  <pre><code>FAIL  test/integration/loggingIn.spec.js (7.398s)
  ● Console
  
  console.log test/integration/loggingIn.spec.js:12
    BEFORE
  console.log test/integration/loggingIn.spec.js:79
    ============ CALLBACK A =============== 2018-12-06T12:00:17.500Z
  console.log test/integration/loggingIn.spec.js:69
    ============ CALLBACK B =============== 2018-12-06T12:00:17.520Z
  console.log test/integration/loggingIn.spec.js:70
    { user: null, isNameTaken: true }
  console.log test/integration/loggingIn.spec.js:71
    { done: { [Function: next] fail: [Function] } }
  console.log test/integration/loggingIn.spec.js:75
    ============ CALLBACK B After done() =============== 2018-12-06T12:00:17.530Z
  
  ● User connection tests › Do not allow duplicate nicknames
  
  Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.
  </code></pre>
  
  <p>Log output shows that callback is fired, and <code>done()</code> should be called. I can't get what's wrong with my test, or with jest, or... well, what's wrong here?</p>
  
  <p><strong>UPD</strong>: here is the repository: <a href="https://github.com/dsamoylov/jest-issue" rel="nofollow noreferrer">https://github.com/dsamoylov/jest-issue</a></p>