SERVER-114647: Add mochalite closer to wrapped JS tests (#44634)

GitOrigin-RevId: 52bc7fe828b49bda55906f6e6f6e36cbd47c4e83
This commit is contained in:
Steve McClure 2025-12-02 10:30:09 -05:00 committed by MongoDB Bot
parent a3f6144b2d
commit 900b1aa895
2 changed files with 10 additions and 0 deletions

View File

@ -2,6 +2,11 @@ const testFile = TestData.jsTestFile;
try {
await import(testFile);
if (typeof globalThis.__mochalite_closer === "function") {
// force the running of mocha-style tests immediately, instead of
// at the close of the shell's scope (outside this runner file)
await globalThis.__mochalite_closer();
}
} finally {
// Run a lightweight command to allow the override file to flush the remaining bulkWrite.
// Ensure this command runs even if the test errors.

View File

@ -2,6 +2,11 @@ const testFile = TestData.multiStmtTxnTestFile;
try {
await import(testFile);
if (typeof globalThis.__mochalite_closer === "function") {
// force the running of mocha-style tests immediately, instead of
// at the close of the shell's scope (outside this runner file)
await globalThis.__mochalite_closer();
}
} finally {
// Run a lightweight command to allow the override file to commit the last command.
// Ensure this command runs even if the test errors.