Skip to content

Commit eb249e2

Browse files
committed
Use ensureTestShellAfterHook to ensure order of hooks
1 parent 37b6a3f commit eb249e2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/e2e-tests/test/e2e.spec.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { Db } from 'mongodb';
44
import { MongoClient } from 'mongodb';
55

66
import { eventually } from '../../../testing/eventually';
7-
import type { TestShell } from './test-shell';
7+
import { ensureTestShellAfterHook, TestShell } from './test-shell';
88
import {
99
skipIfServerVersion,
1010
startSharedTestServer,
@@ -1378,7 +1378,11 @@ describe('e2e', function () {
13781378
};
13791379
});
13801380

1381+
// Ensure the afterEach below runs after shells are killed
1382+
ensureTestShellAfterHook('afterEach', this);
1383+
13811384
afterEach(async function () {
1385+
TestShell.assertNoOpenShells();
13821386
try {
13831387
await fs.rm(homedir, { recursive: true, force: true });
13841388
} catch (err: any) {

0 commit comments

Comments
 (0)