title: Using expect.assertions(x) vs using fail() in jest tests
body: <p>I am setting up some asynchronous <code>junit</code> typescript tests and it seems I don't understand the documentation correctly.</p>
  
  <p>I wrote a test asking a web API for a specific svg image by sending the ID of the image.</p>
  
  <p>The test sends no ID so the web API should return http code 404. This the test and it works well:</p>
  
  <pre><code>test("getSvgByImageId unknown", () =&gt; {
      expect.assertions(1);
  
      return client.getSvgImageById("")
      .then(svg =&gt; {
          fail("API should return error")
      })
      .catch(error =&gt; {
          expect(error.status).toBe(404);
      })
  });
  </code></pre>
  
  <p>But why should I use the expect.assertions(x) when I use the fail() method? The test also works without the expect.assertions(x) line.</p>