mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-19 16:39:50 +00:00
test: remove redundant theatrical assertions (#3120)
Remove bare toHaveBeenCalled() checks that preceded stronger content assertions, and strengthen the "shows manual install command" test to verify the actual install script URL appears in output. Affected files: - cmd-update-cov: remove redundant consoleSpy.toHaveBeenCalled() (x2), strengthen "shows manual install command" to check install.sh content - update-check: remove redundant consoleErrorSpy.toHaveBeenCalled() (x2) that were immediately followed by .mock.calls content assertions - recursive-spawn: remove redundant logInfoSpy.toHaveBeenCalled() before content check - cmd-interactive: remove redundant mockIntro/mockOutro.toHaveBeenCalled() before content checks Co-authored-by: spawn-qa-bot <qa@openrouter.ai> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
a3ce5d8afd
commit
e024900e38
4 changed files with 5 additions and 9 deletions
|
|
@ -279,7 +279,6 @@ describe("cmdInteractive", () => {
|
|||
|
||||
await cmdInteractive();
|
||||
|
||||
expect(mockIntro).toHaveBeenCalled();
|
||||
const introArg = mockIntro.mock.calls[0]?.[0] ?? "";
|
||||
expect(introArg).toContain("spawn");
|
||||
});
|
||||
|
|
@ -345,7 +344,6 @@ describe("cmdInteractive", () => {
|
|||
|
||||
await cmdInteractive();
|
||||
|
||||
expect(mockOutro).toHaveBeenCalled();
|
||||
const outroArg = mockOutro.mock.calls[0]?.[0] ?? "";
|
||||
expect(outroArg).toContain("spawn script");
|
||||
});
|
||||
|
|
|
|||
|
|
@ -204,8 +204,6 @@ describe("cmdUpdate", () => {
|
|||
runUpdate: updateFn,
|
||||
});
|
||||
|
||||
// consoleSpy (console.log) should have been called
|
||||
expect(consoleSpy).toHaveBeenCalled();
|
||||
expect(clack.logInfo).toHaveBeenCalledWith(expect.stringContaining("Run spawn again"));
|
||||
});
|
||||
|
||||
|
|
@ -220,7 +218,10 @@ describe("cmdUpdate", () => {
|
|||
runUpdate: updateFn,
|
||||
});
|
||||
|
||||
// Should show the install command
|
||||
expect(consoleSpy).toHaveBeenCalled();
|
||||
expect(clack.logError).toHaveBeenCalledWith(expect.stringContaining("Auto-update failed"));
|
||||
const allLoggedLines = consoleSpy.mock.calls.map((c: unknown[]) => String(c[0] ?? ""));
|
||||
expect(allLoggedLines.some((line: string) => line.includes("install.sh") || line.includes("install.ps1"))).toBe(
|
||||
true,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -401,7 +401,6 @@ describe("recursive spawn", () => {
|
|||
|
||||
await cmdTree();
|
||||
|
||||
expect(logInfoSpy).toHaveBeenCalled();
|
||||
const calls = logInfoSpy.mock.calls.map((args) => String(args[0]));
|
||||
expect(calls.some((msg) => msg.includes("No spawn history found"))).toBe(true);
|
||||
logInfoSpy.mockRestore();
|
||||
|
|
|
|||
|
|
@ -119,7 +119,6 @@ describe("update-check", () => {
|
|||
await checkForUpdates();
|
||||
|
||||
// Should have printed update message to stderr
|
||||
expect(consoleErrorSpy).toHaveBeenCalled();
|
||||
const output = consoleErrorSpy.mock.calls.map((call) => call[0]).join("\n");
|
||||
expect(output).toContain("Update available");
|
||||
expect(output).toContain("99.0.0");
|
||||
|
|
@ -181,7 +180,6 @@ describe("update-check", () => {
|
|||
await checkForUpdates();
|
||||
|
||||
// Should have printed error message
|
||||
expect(consoleErrorSpy).toHaveBeenCalled();
|
||||
const output = consoleErrorSpy.mock.calls.map((call) => call[0]).join("\n");
|
||||
expect(output).toContain("Auto-update failed");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue