-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
DevProd Correctness
-
Fully Compatible
-
Correctness 2025-08-11
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Summary
Mochalite framework should run after() hook even if assertion failures occur in it() blocks.
Steps to Reproduce
- import {after, it} from "jstests/libs/mochalite.js";
it("assertion failure", function() { assert(false); });
{ jsTest.info.log("this should run."); }
after(function());
Expected Result
The after block should run even though the assert failed in the it() block.
Actual Result
after() block doesn't run.
Impact
We currently can't use the mochalite framework for testing as we need to clean up some test set up after the test runs. Since the mochalite after() doesn't work, we are forced to use try/finally blocks in testing.