title: Jest tests leaking due to improper teardown
body: <p>While doing testing with Jest I am getting a warning saying &quot;A worker process has failed to exit gracefully and has been force exited. This is likely caused by tests leaking due to improper teardown. Try running with --detectOpenHandles to find leaks.&quot; I realize that this is coming because inside of one of functions I use Bull <a href="https://github.com/OptimalBits/bull" rel="noreferrer">https://github.com/OptimalBits/bull</a> which uses Redis. So when adding a task to the queue it results in this warning. I use default Bull configuration (no configuration). I do have a mockup for the add function on the queue which is used by Jest, however it didn't help.</p>
  <pre class="lang-js prettyprint-override"><code>const notificationQueue = {
    add: jest.fn().mockImplementation((data: any, opts?: JobOptions) =&gt; {}),
  };
  </code></pre>
  <p>I'd like to know if there is a way to avoid this warning. If it helps I use in memory mongo for testing but redis is an actual one. As a side note when I run each test suite separately I am not seeing this warning, only when I run all tests.</p>