reject-requires-await.rst (581B)
1 reject-requires-await 2 ===================== 3 4 `Assert.rejects` must be preceded by an `await`, otherwise the assertion 5 may not be completed before the test finishes, might not be caught 6 and might cause intermittent issues in other tests. 7 8 Examples of incorrect code for this rule: 9 ----------------------------------------- 10 11 .. code-block:: js 12 13 Assert.rejects(myfunc(), /startup failed/, "Should reject"); 14 15 Examples of correct code for this rule: 16 --------------------------------------- 17 18 .. code-block:: js 19 20 await Assert.rejects(myfunc(), /startup failed/, "Should reject");