mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-19 08:01:17 +00:00
test: remove duplicate and theatrical tests (#2646)
- security.test.ts: remove "should handle prompt with only whitespace"
(line 614) — fully covered by "should reject empty prompts" (line 363)
which already tests validatePrompt(" ") and validatePrompt("\n\t")
- script-failure-guidance.test.ts: consolidate three separate "returns
simple command" tests (no-arg, undefined, empty string) into one.
All three called buildRetryCommand with absent/falsy prompt and
asserted identical output — the input variation is not a meaningful
behavioral distinction.
net: 3 tests removed. 1410 pass, 0 fail. biome lint clean.
Co-authored-by: spawn-qa-bot <qa@openrouter.ai>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: L <6723574+louisgv@users.noreply.github.com>
This commit is contained in:
parent
333a3928ad
commit
65b29e3757
2 changed files with 3 additions and 13 deletions
|
|
@ -401,8 +401,10 @@ describe("getSignalGuidance", () => {
|
|||
});
|
||||
|
||||
describe("buildRetryCommand", () => {
|
||||
it("should return simple command without prompt", () => {
|
||||
it("should return simple command when prompt is absent, undefined, or empty", () => {
|
||||
expect(buildRetryCommand("claude", "sprite")).toBe("spawn claude sprite");
|
||||
expect(buildRetryCommand("codex", "vultr", undefined)).toBe("spawn codex vultr");
|
||||
expect(buildRetryCommand("codex", "vultr", "")).toBe("spawn codex vultr");
|
||||
});
|
||||
|
||||
it("should include --prompt when prompt is provided", () => {
|
||||
|
|
@ -434,14 +436,6 @@ describe("buildRetryCommand", () => {
|
|||
expect(result).toBe('spawn claude sprite --prompt "Fix \\"all\\" bugs"');
|
||||
});
|
||||
|
||||
it("should return simple command when prompt is undefined", () => {
|
||||
expect(buildRetryCommand("codex", "vultr", undefined)).toBe("spawn codex vultr");
|
||||
});
|
||||
|
||||
it("should return simple command when prompt is empty string", () => {
|
||||
expect(buildRetryCommand("codex", "vultr", "")).toBe("spawn codex vultr");
|
||||
});
|
||||
|
||||
// ── spawnName parameter (issue #1709) ────────────────────────────────────
|
||||
|
||||
it("should include --name flag when spawnName is provided without prompt", () => {
|
||||
|
|
|
|||
|
|
@ -610,8 +610,4 @@ describe("validatePrompt", () => {
|
|||
it("should accept semicolons not followed by rm", () => {
|
||||
expect(() => validatePrompt("echo hello; echo world")).not.toThrow();
|
||||
});
|
||||
|
||||
it("should handle prompt with only whitespace", () => {
|
||||
expect(() => validatePrompt(" \t\n ")).toThrow("Prompt is required but was not provided");
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue