test: dedupe and optimize test suites

This commit is contained in:
Peter Steinberger
2026-02-19 15:18:50 +00:00
parent b0e55283d5
commit a1cb700a05
80 changed files with 2627 additions and 2962 deletions

View File

@@ -69,4 +69,17 @@ describe("runInteractiveOnboarding", () => {
Number.MAX_SAFE_INTEGER;
expect(restoreOrder).toBeLessThan(exitOrder);
});
it("rethrows non-cancel errors after restoring terminal state", async () => {
const runtime = makeRuntime();
const err = new Error("boom");
mocks.runOnboardingWizard.mockRejectedValueOnce(err);
await expect(runInteractiveOnboarding({} as never, runtime)).rejects.toThrow("boom");
expect(runtime.exit).not.toHaveBeenCalled();
expect(mocks.restoreTerminalState).toHaveBeenCalledWith("onboarding finish", {
resumeStdinIfPaused: false,
});
});
});