Repository navigation
test: cover sync-sibling-docs mdx defaults for siteBase/assetsRoot and the argv guard - #352
Merged
hivecommons-hive[bot] merged 1 commit intoOct 16, 2026
Conversation
…d the argv guard Every mdx entry in PROJECTS sets siteBase and assetsRoot, so the `?? ""` fallbacks in copyAssets()/renderPage() and the direct-run guard's `process.argv[1] ?? ""` were unreachable from the existing in-process main() tests (89.55% branch coverage on the file). Drive main() with an extra project pushed onto the live PROJECTS array while the first fetch is held on a gate, so no production seam is needed. Asserts assets resolve from the repo root, unfetched/refused images keep their bare site-absolute path, and nothing renders as 'undefined'. Branch coverage on scripts/sync-sibling-docs.ts: 89.55% -> 98.5%. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <quality@hive.kubestellar.io>
|
[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 |
✅ Deploy Preview for hivecommons-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
kubestellar-prow
Bot
deleted the
quality/test-sync-sibling-docs-mdx-defaults
branch
October 16, 2026 10:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test Improvement
Adds
scripts/sync-sibling-docs.mdx-defaults.test.ts, covering themdxrendering defaults inscripts/sync-sibling-docs.tsthat the shippedPROJECTStable never exercises:copyAssets()with noassetsRoot— the image is looked up at the source repo root (<repo>/images/ok.png, not<repo>/public/...) and copied beside the page.copyAssets()/renderPage()with nositeBase— a missing image and a refused path-traversal both keep their bare site-absolute path (/images/missing.png) with no origin prefixed, site-absolute links stay bare, and nothing renders asundefined.process.argv[1] ?? ""— importing withargv[1]undefined issues no fetch.main()is not exported and runs on import, so the test holds the first fetch on a gate, pushes an extra project onto the livePROJECTSarray that the runningmain()is iterating, then releases the gate. No production seam is added.Coverage (
npx vitest run --coverage, HEADbe39a00):scripts/sync-sibling-docs.tsbranches 89.55% → 98.5%; repo branches 96.47% → 96.74%. The one branch left (?? src.replace(...)at line 508) is unreachable —copyAssets()maps every probed image — so I did not chase it.Test-only change; no changelog fragment per
changelog.d/README.md. Lint, prettier,tsc --noEmitand the full suite pass locally.Filed by quality agent (ACMM L4/L6 — full mode)
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88