Skip to content

Commit

Permalink
Remove "runAndGetOutputWithoutErrors"
Browse files Browse the repository at this point in the history
  • Loading branch information
kraenhansen committed Sep 26, 2024
1 parent 0f92ba5 commit 0273a4a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
10 changes: 6 additions & 4 deletions packages/e2e-tests/test/e2e-snapshot.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
skipIfApiStrict,
startSharedTestServer,
} from '../../../testing/integration-testing-hooks';
import { TestShell } from './test-shell';
import { expect } from 'chai';

const setDifference = <T>(a: T[], b: T[]) => a.filter((e) => !b.includes(e));
Expand Down Expand Up @@ -56,9 +55,12 @@ describe('e2e snapshot support', function () {
atReplEvalTime,
] = (
await Promise.all(
argLists.map((args) =>
TestShell.runAndGetOutputWithoutErrors({ args })
)
argLists.map(async (args) => {
const shell = this.startTestShell({ args });
await shell.waitForExit();
shell.assertNoErrors();
return shell.output;
})
)
).map((output) =>
(JSON.parse(output) as string[])
Expand Down
11 changes: 1 addition & 10 deletions packages/e2e-tests/test/test-shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class TestShell {
/**
* Starts a test shell.
*
* Beware that the caller is responsible for calling {@link TestShell.kill} (and potentially {@link TestShell.waitForExit}).
* Beware that the caller is responsible for calling {@link kill} (and potentially {@link waitForExit}).
*
* Consider calling the `startTestShell` function on a {@link Mocha.Context} instead, as that manages the lifetime the shell
* and ensures it gets killed eventually.
Expand Down Expand Up @@ -108,15 +108,6 @@ export class TestShell {
return shell;
}

static async runAndGetOutputWithoutErrors(
options: TestShellOptions
): Promise<string> {
const shell = this.start(options);
await shell.waitForExit();
shell.assertNoErrors();
return shell.output;
}

debugInformation() {
return {
pid: this.process.pid,
Expand Down

0 comments on commit 0273a4a

Please sign in to comment.