Skip to content

fix: CLI error-path tests rely on execFileSync stderr message format #278

@flyingrobots

Description

@flyingrobots

Problem

CLI error-path tests in test/content.test.js assert error messages via .toThrow(/regex/) matching against execFileSync error messages, which include stderr output. This coupling is fragile:

  • Node.js could change the error message format
  • The assertions depend on console.error() output from the CLI, not the domain error

Possible Fix

Create a runCliExpectError(args, cwd) helper that catches the execFileSync error and returns { stderr, stdout, exitCode }, then assert against stderr directly instead of the error message.

Context

Surfaced during M13 VESSEL review (PR #276, round 5).

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtTechnical debt that needs addressing

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions