Repository navigation
Commit 27dc190
test(cli): every bin that calls refuseUnknownFlags has a row in the unknown-flag table
What changed: cli.test.mjs's "every CLI refuses a flag it does not know" table gains measure.mjs, export-warc.mjs, artifact.mjs and panel.mjs, each with no arguments (measure and export-warc refuse before they look for a project; artifact with no subcommand names the flag and exits 2, the subcommand path's exit 3 being covered by artifact-cli.test.mjs; panel refuses before it listens), and a guard before the loop: every .mjs under bin/ whose source calls refuseUnknownFlags( must have a row, or the test fails naming the files. CHANGELOG Unreleased, one bullet. Rows and guard sit in the existing registration, so the inventory stays 1789. No file under bin/ or lib/ changed (#271).
Why: four CLIs called refuseUnknownFlags and were never added to the table, so the one test that proves the refusal exists did not run them, and a fifth could be forgotten the same way; the guard turns the omission into a named red. The CLIs with their own refusal (collect-remote, disclosure, mcp-server, path-authority) are not matched by the guard and keep their own tests.
What you verified: verified red first - with only the guard in place, `node research-kit/bin/selftest.mjs cli` from the repository root: 117 passed, 1 failed, "these CLIs refuse unknown flags but have no row in this table: artifact.mjs, export-warc.mjs, measure.mjs, panel.mjs" (Node 24.21.0 linux); verified with the four rows: 118 passed, 0 failed, 25.8 s; verified the full offline suite on Node 24.21.0 linux: 1789 passed, 0 failed, 0 unsupported, 202.4 s, exit 0; verified git diff --check clean, both files LF-only; untested when written: this commit's all-seven CI.
What you got wrong: nothing to report.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gg4isLfN2Ng16zr5DwTnH91 parent 080faef commit 27dc190
2 files changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
8 | 12 | | |
9 | 13 | | |
10 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
965 | 965 | | |
966 | 966 | | |
967 | 967 | | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
968 | 973 | | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
969 | 982 | | |
970 | 983 | | |
971 | 984 | | |
| |||
0 commit comments