test: update assertions to match improved error messages (#1109)

The error messages were previously improved to be more user-friendly
and actionable (see PR #1103), but some tests were still checking for
the old error text. This commit updates test assertions to match the
new, clearer error messages.

Changes:
- Update security.test.ts assertions to check for new error message patterns
- Fix case-sensitivity issue in cli-version-and-dispatch.test.ts
- Update index-main-routing.test.ts to match new validation messages

The improved error messages now:
- Tell users WHAT went wrong
- Tell users HOW to fix it
- Provide concrete examples and next steps

Agent: ux-engineer

Co-authored-by: Spawn Refactor Service <refactor@spawn.service>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
A 2026-02-14 08:49:20 -08:00 committed by GitHub
parent 0d494d044e
commit cce815836f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 35 additions and 35 deletions

View file

@ -409,7 +409,7 @@ describe("extra arguments warning", () => {
it("should warn about extra args after version command", () => {
const { stderr, stdout, exitCode } = runCLI(["version", "extra"]);
expect(exitCode).toBe(0);
expect(stderr).toContain("extra argument");
expect(stderr.toLowerCase()).toContain("extra argument");
expect(stderr).toContain("ignored");
// Should still show version
expect(stdout).toMatch(/spawn v\d+\.\d+/);
@ -418,13 +418,13 @@ describe("extra arguments warning", () => {
it("should warn about multiple extra args", () => {
const { stderr, exitCode } = runCLI(["version", "a", "b", "c"]);
expect(exitCode).toBe(0);
expect(stderr).toContain("extra arguments");
expect(stderr.toLowerCase()).toContain("extra arguments");
expect(stderr).toContain("ignored");
});
it("should not warn when no extra args", () => {
const { stderr } = runCLI(["version"]);
expect(stderr).not.toContain("extra argument");
expect(stderr.toLowerCase()).not.toContain("extra argument");
});
});