Skip to content

test: make CLI write error assertion deterministic - #2

Merged
tbrandenburg merged 1 commit into
mainfrom
codex/run-typescript-test-suite
Jan 12, 2026
Merged

test: make CLI write error assertion deterministic#2
tbrandenburg merged 1 commit into
mainfrom
codex/run-typescript-test-suite

Conversation

@tbrandenburg

Copy link
Copy Markdown
Owner

Motivation

  • Avoid flaky test behavior caused by relying on privileged filesystem paths like /root which vary by environment.
  • Ensure the CLI write-error test triggers a deterministic failure mode that does not depend on permissions.
  • Harden the test assertion so it reliably inspects CLI error output across different Node/spawn wrappers.

Description

  • Updated src/cli/index.test.ts to create a local output-dir under the test tempDir and pass that directory to the CLI -o option to trigger an EISDIR write error deterministically.
  • Replaced the previous privileged path usage with the deterministic directory write failure approach in the should handle file write errors gracefully test.
  • Improved the error assertion to read stderr, stdout, or error.message and assert that the output contains the stable message Failed to write file:.

Testing

  • Ran make qa, which executes lint, format, build, and vitest run as part of the QA pipeline.
  • All automated checks completed successfully and vitest finished with all tests passing (full test suite passed).

Codex Task

@tbrandenburg
tbrandenburg merged commit 7d1b063 into main Jan 12, 2026
1 check passed
@tbrandenburg
tbrandenburg deleted the codex/run-typescript-test-suite branch January 12, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant