Skip to content

Commit

Permalink
Use ensureTestShellAfterHook to ensure order of hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
kraenhansen committed Sep 26, 2024
1 parent 65177ae commit bd0bd7b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/e2e-tests/test/e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit bd0bd7b

Please sign in to comment.