mirror of https://github.com/mongodb/mongo
SERVER-114647: Add mochalite closer to wrapped JS tests (#44634)
GitOrigin-RevId: 52bc7fe828b49bda55906f6e6f6e36cbd47c4e83
This commit is contained in:
parent
a3f6144b2d
commit
900b1aa895
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue