From bd0bd7b71367b21decc620bccbaa3f0aa74fb8c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Thu, 26 Sep 2024 09:33:48 +0200 Subject: [PATCH] Use ensureTestShellAfterHook to ensure order of hooks --- packages/e2e-tests/test/e2e.spec.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/e2e-tests/test/e2e.spec.ts b/packages/e2e-tests/test/e2e.spec.ts index a6fb727eff..a3236fd990 100644 --- a/packages/e2e-tests/test/e2e.spec.ts +++ b/packages/e2e-tests/test/e2e.spec.ts @@ -4,7 +4,7 @@ import type { Db } from 'mongodb'; import { MongoClient } from 'mongodb'; import { eventually } from '../../../testing/eventually'; -import type { TestShell } from './test-shell'; +import { ensureTestShellAfterHook, TestShell } from './test-shell'; import { skipIfServerVersion, startSharedTestServer, @@ -1378,7 +1378,11 @@ describe('e2e', function () { }; }); + // Ensure the afterEach below runs after shells are killed + ensureTestShellAfterHook('afterEach', this); + afterEach(async function () { + TestShell.assertNoOpenShells(); try { await fs.rm(homedir, { recursive: true, force: true }); } catch (err: any) {