Summary
The two files users actually execute have no test file:
| File |
Role |
Test file |
packages/cli/src/cli.ts |
the fixmap binary — arg parsing, exit codes, output routing |
none |
packages/action/src/index.ts |
the Action entry point — inputs, step summary, outputs, comment gating |
none |
Existing coverage is packages/cli/test/{mcp,repository-source}.test.ts and packages/action/test/github.test.ts — the libraries behind both entry points, but never the entry points themselves. apps/web has no test script at all.
Why this is worth fixing
Several defects filed alongside this one live exactly in the untested files, and each is the kind a single assertion would have caught:
fixmap plan --version reports "Unknown or incomplete option(s)"
--format yaml reports --format and yaml as unknown options
- the Action inherits
GITHUB_TOKEN / GITHUB_STEP_SUMMARY / GITHUB_OUTPUT from the ambient environment with no assertion on what it writes
Both files are also awkward to test as written, which is likely why they are not: cli.ts runs top-level statements and calls process.exit() inline, and index.ts is entirely top-level side effects. That shape is the underlying problem — the coverage gap is a symptom.
Suggested fix
- Extract the testable core from each entry point:
cli.ts -> export parseArgs(argv) and a run(options): Promise<{ stdout, stderr, exitCode }>; keep only process.exit(await run(...)) at the top level. parseArgs is a pure function and covers the whole flag matrix cheaply.
index.ts -> export runAction(env, deps) taking the environment and an injected GitHub client; the module top level just calls it.
- Add table-driven tests for the flag matrix:
--version / -h in each position, --format valid + invalid, --issue=/--issue inline vs separated values, missing task signal, unknown options, --output writing to a file.
- Add Action tests that point
GITHUB_STEP_SUMMARY and GITHUB_OUTPUT at temp files and assert the exact bytes written — particularly that the report<<delimiter heredoc is well-formed.
Summary
The two files users actually execute have no test file:
packages/cli/src/cli.tsfixmapbinary — arg parsing, exit codes, output routingpackages/action/src/index.tsExisting coverage is
packages/cli/test/{mcp,repository-source}.test.tsandpackages/action/test/github.test.ts— the libraries behind both entry points, but never the entry points themselves.apps/webhas no test script at all.Why this is worth fixing
Several defects filed alongside this one live exactly in the untested files, and each is the kind a single assertion would have caught:
fixmap plan --versionreports "Unknown or incomplete option(s)"--format yamlreports--formatandyamlas unknown optionsGITHUB_TOKEN/GITHUB_STEP_SUMMARY/GITHUB_OUTPUTfrom the ambient environment with no assertion on what it writesBoth files are also awkward to test as written, which is likely why they are not:
cli.tsruns top-level statements and callsprocess.exit()inline, andindex.tsis entirely top-level side effects. That shape is the underlying problem — the coverage gap is a symptom.Suggested fix
cli.ts-> exportparseArgs(argv)and arun(options): Promise<{ stdout, stderr, exitCode }>; keep onlyprocess.exit(await run(...))at the top level.parseArgsis a pure function and covers the whole flag matrix cheaply.index.ts-> exportrunAction(env, deps)taking the environment and an injected GitHub client; the module top level just calls it.--version/-hin each position,--formatvalid + invalid,--issue=/--issueinline vs separated values, missing task signal, unknown options,--outputwriting to a file.GITHUB_STEP_SUMMARYandGITHUB_OUTPUTat temp files and assert the exact bytes written — particularly that thereport<<delimiterheredoc is well-formed.