diff --git a/packages/e2e-tests/test/test-shell.ts b/packages/e2e-tests/test/test-shell.ts index f79668cef..3cbb3ae2e 100644 --- a/packages/e2e-tests/test/test-shell.ts +++ b/packages/e2e-tests/test/test-shell.ts @@ -156,8 +156,10 @@ export class TestShell { } static async killAll(): Promise { + // Using splice to mutate the array of open shells in-place + const openShells = TestShell._openShells.splice(0); await Promise.all( - TestShell._openShells.map((shell) => { + openShells.map((shell) => { shell.kill(); return shell.waitForExit(); })