title: Randomly failing tests jest and supertest Node.js
body: <p>so long story short I'm developing RESTapi that takes a movie title on POST request to the /movies route, fetches info about that movie from external api and saves that object to the database. On POST /comments you add a comment to the different collection but every comment has a 'movie_id' property that has an associated movie.</p>
  
  <p>That's my first bigger project so I'm trying to write integrational tests.
  Everything is great, at least in my opinion, except 3 weird test cases that are failing just out of nowhere. Tests could pass 10 times in a row and then suddenly that weird 'jest' timer shows up and 3 cases fail.</p>
  
  <p>I'm using native mongodb driver, express and jest with supertest for testing, dropping test-database BeforeAll and AfterEach, I have no idea whats the reason of that.</p>
  
  <p>Timer thingy:
  <a href="https://i.stack.imgur.com/gKxh9.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/gKxh9.jpg" alt="enter image description here"></a></p>
  
  <p>And after timer this shows up, failed tests:
  <a href="https://i.stack.imgur.com/QfkUR.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/QfkUR.jpg" alt="enter image description here"></a></p>
  
  <p>Full source code is here <a href="https://github.com/lekterable/netguru-movies" rel="noreferrer">GITHUB</a></p>
  
  <p>Other failed cases:
  <a href="https://i.stack.imgur.com/YzttQ.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/YzttQ.jpg" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/F1O3A.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/F1O3A.jpg" alt="enter image description here"></a></p>
  
  <p>Any ideas, tips?</p>