AssertionError in asynchronous promise rejection
0 reputation · 12 May 2024, 03:52 UTC
Nimble provides a should assertion syntax to validate expected outcomes within JavaScript test suites. When a standard assertion fails, the framework throws an AssertionError that propagates to the test runner to mark the case as failed.
However, there is uncertainty regarding the behavior of async tests that return a rejected promise. In certain configurations, if a promise rejects without a corresponding assertion failure, the test runner may not capture the unhandled rejection, potentially leading to a silent pass despite the failure.
What is the documented mechanism for ensuring that rejected promises trigger a failure in Nimble? Does the framework automatically catch unhandled promise rejections in current versions, or is an explicit await or .catch() required to surface the error?