Repository navigation
test(pages-build, redirect-targets): assert the gates' remaining branches and clear their coverage-floor entries - #325
Conversation
…ches and clear their coverage-floor entries pages-build: unpublishedReason/publishProblems with a _config.yml that has no include: list, off-site URLs in the published-URL list, and contentDotDirs recursing into a dot-directory whose files sit one level down (and one holding only empty subdirectories). redirect-targets: a redirect page with no <a> reports both the link href and the link text as missing; single-quoted attribute values are read the same as double-quoted ones. Both TEST_HELPER_BASELINE entries drop to zero and are deleted. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Read the functions under test at the PR head rather than just the diff; this looks correct to me.
scripts/pages-build.test.mjs:99and:149— both?? []fallbacks are now reached byparseConfig("exclude:\n - docs\n")/parseConfig("exclude: []\n"), which leavelists.includeundefined (the tests assert that precondition before using it).:128—hasFilesrecursion is reached by.nested/sub/file.txt, and.hollow/sub/deeper(empty) correctly stays out.:153— thecontinueon off-site URLs is reached viaurlToRelPathreturning null forhttps://example.com/.scripts/redirect-targets.test.mjs:155—?? m[2]is reached by rewritinghref="…"/content="…"to single quotes;:170— both: undefinedarms are reached by stripping the<a>, and the two expected "is missing" messages match theattrChecks/textChecksorder at:179–:193.
Checked the ratchet itself: with the baseline entries deleted but the new tests reverted, coverage-floor.test.mjs fails naming exactly those 8 ranges (4 + 4); with the PR as-is, node --test scripts/pages-build.test.mjs scripts/redirect-targets.test.mjs scripts/coverage-floor.test.mjs → 62 pass, 0 fail. Tests-only; no site or workflow files touched.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
Why
coverage-floor.test.mjsratchets the dead branch ranges inside each gate's own top-level functions; the end state is an emptyTEST_HELPER_BASELINE. This clears the two smallest remaining entries (4 ranges each), continuing #318/#319/#320.The branches were not hypothetical:
unpublishedReasonandpublishProblemswere only ever run with a config that has aninclude:list, so the?? []fallbacks that decide "no include: means every dot-directory is dropped" had never executed;contentDotDirshad never recursed past the first level, so a dot-directory with files one level down was untested; andredirectPageProblemshad never seen a page without an<a>(both "missing" reports) or a single-quoted attribute (the?? m[2]arm ofattr()).Evidence
pages-build.test.mjs: 0 dead ranges left, baseline allows 4 — … delete the entryand the same forredirect-targets.test.mjs; after deleting both entriesnode --test scripts/coverage-floor.test.mjspasses 14/14.node --test scripts/*.test.mjs→ 845 pass, 0 fail (was 838).Tests-only change under
scripts/; no page or workflow touched.Filed by quality agent (ACMM L4/L6 — full mode)
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88