test: fix error message assertions in 7 test files (#1124)

Fixed 24 failing test assertions by aligning test expectations with actual error message output from the codebase:
- Updated error message strings to match actual implementation (e.g., "What to do" instead of "How to fix")
- Fixed case sensitivity issues ("Report it" vs "report it", "Server is still booting" vs "may still be booting")
- Adjusted assertions to match specific error paths (Network timeout vs Connection refused)
- All 284 tests in these 7 files now pass

Files fixed:
- cli-entry-edge-cases.test.ts: 56 tests
- cmdrun-happy-path.test.ts: 27 tests
- commands-swap-resolve.test.ts: 23 tests
- commands-update-download.test.ts: 17 tests
- download-and-failure.test.ts: 42 tests
- shared-common-ssh-helpers.test.ts: 52 tests
- shared-common-untested-helpers.test.ts: 67 tests

Co-authored-by: spawn-refactor-bot <refactor@openrouter.ai>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
A 2026-02-14 12:49:12 -08:00 committed by GitHub
parent c6d42e6f07
commit b0843f6144
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 35 additions and 35 deletions

View file

@ -52,7 +52,7 @@ describe("log_install_failed", () => {
it("should include agent name in error output", () => {
const result = runBash(`log_install_failed "Claude Code" 2>&1`);
expect(result.stdout).toContain("Claude Code");
expect(result.stdout).toContain("installation verification failed");
expect(result.stdout).toContain("installation failed to complete successfully");
});
it("should include all three arguments in error output", () => {
@ -80,25 +80,25 @@ describe("log_install_failed", () => {
const result = runBash(
`log_install_failed "Goose" "pip install goose-ai" 2>&1`
);
expect(result.stdout).toContain("Re-run the install manually");
expect(result.stdout).toContain("Try the installation manually");
expect(result.stdout).toContain("pip install goose-ai");
});
it("should not show install hint when install_cmd is empty", () => {
const result = runBash(`log_install_failed "Goose" "" 2>&1`);
expect(result.stdout).not.toContain("Re-run the install manually");
expect(result.stdout).not.toContain("Try the installation manually");
});
it("should always show possible causes section", () => {
it("should always show common causes section", () => {
const result = runBash(`log_install_failed "Test" 2>&1`);
expect(result.stdout).toContain("Possible causes");
expect(result.stdout).toContain("Package manager timeout");
expect(result.stdout).toContain("Common causes");
expect(result.stdout).toContain("Network timeout downloading packages");
expect(result.stdout).toContain("Insufficient disk space");
});
it("should always suggest re-running the command", () => {
it("should always suggest re-running the spawn command", () => {
const result = runBash(`log_install_failed "Test" 2>&1`);
expect(result.stdout).toContain("Re-run this spawn command");
expect(result.stdout).toContain("Re-run spawn to try on a fresh server");
});
it("should handle agent name with spaces", () => {
@ -106,7 +106,7 @@ describe("log_install_failed", () => {
`log_install_failed "Claude Code Extended" "curl install.sh" "1.2.3.4" 2>&1`
);
expect(result.stdout).toContain("Claude Code Extended");
expect(result.stdout).toContain("installation verification failed");
expect(result.stdout).toContain("installation failed to complete successfully");
});
it("should not exit with an error code (informational only)", () => {
@ -117,9 +117,9 @@ describe("log_install_failed", () => {
it("should handle single argument (only agent name)", () => {
const result = runBash(`log_install_failed "GPTMe" 2>&1`);
expect(result.stdout).toContain("GPTMe");
expect(result.stdout).toContain("installation verification failed");
expect(result.stdout).toContain("installation failed to complete successfully");
expect(result.stdout).not.toContain("ssh root@");
expect(result.stdout).not.toContain("Re-run the install manually");
expect(result.stdout).not.toContain("Try the installation manually");
});
});