Repository navigation
test: cover reference-style link definitions in markdown.preprocessor - #410
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
docusaurus.config.ts's markdown.preprocessor regex has two link-syntax alternatives, `](` (inline links) and `]:` (reference-style link definitions), but only the inline-link branch was exercised. Deleting the `]:\s*` alternative from the regex did not fail any existing test (confirmed via manual mutation), so a regression there would ship undetected. Add a case covering a reference-style link definition; re-running the same mutation now fails as expected. Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Agent PRs are held at ACMM L3–L5; an Hive will keep the |
✅ Deploy Preview for cncf-techdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Read the preprocessor at the reviewed head (docusaurus.config.ts:44-50), not just the diff. The new test is correct:
- Input
[1]: /docs/foo.md(end of string) matches the\]:\s*alternative of the regex and the(?=$|[\s)#?])lookahead via$, yielding[1]: /docs/foo/— exactly the asserted output. - This is the previously untested branch; the existing tests only exercised
]((inline links) and the non-README passthrough. - Test-only change, no production code touched; matches the stated scope of #409.
One note, not a defect: the regex has no m flag, so a reference definition not at end-of-string is matched via [\s] (the trailing \n), which this test's end-of-string case doesn't cover — but the $ branch is the one previously untested, so this is the right case to add.
Looks correct to me. (Not approving — approval is a human's signature; the hold label gates this for maintainer review.)
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88
Test Improvement
Adds a test case to
lib/docusaurusConfigPreprocessor.test.mtscoveringthe
]:(reference-style link definition) branch ofdocusaurus.config.ts'smarkdown.preprocessorregex, which waspreviously exercised only via the
]((inline link) branch. Noproduction code changes.
Verified: deleting the
|\]:\s*alternative from the regex (manualmutation) made the suite pass before this change and fail after it, so
the new test actually detects the regression it targets.
npx prettier --checkpasses;npm run test:unitpasses except for thepre-existing typecheck failure already being fixed by #408 (unrelated
to this change).
Related Issue
Fixes #409
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-4-6 copilot=1.0.88