Repository navigation
test: cover sidebars.ts and sidebarsAnalyses.ts exported config - #432
Conversation
Both files are imported by docusaurus.config.ts but no unit test ever imported either one, so c8's default (non --all) test:coverage report silently omitted them instead of scoring them. Add a direct unit test per file asserting the exported sidebar shape, so a regression to the autogenerated docSidebar/analysesSidebar config fails fast in the unit suite rather than only surfacing in a full Docusaurus build. Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
Important Ready for review: held for a maintainer 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 The hive's work on this PR is done. 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 tree at head 5c94878, not just the diff. Verified:
sidebars.ts:15-17exports exactly{ docSidebar: [{ type: 'autogenerated', dirName: '.' }] }(thetutorialSidebarblock is commented out), andsidebarsAnalyses.ts:3-5exports exactly{ analysesSidebar: [{ type: 'autogenerated', dirName: '.' }] }- bothassert.deepEqualexpectations are correct.package.json:42globslib/**/*.test.mts, so both new files are picked up bytest:unitand therefore by the c8 coverage run.- Ran both tests at this head with
node --experimental-strip-types --test: 2/2 pass. Theimport typelines strip cleanly, so no runtime dependency on the Docusaurus packages. - Test-only change, no production code touched; follows the existing
lib/*.test.mtspattern and comment style.
One nit, not a defect: the PR body says the gate is 99/97/100, but package.json:39 at this head sets 100 across all four thresholds. Body-only inaccuracy.
Looks correct to me. Human approval still required per repo policy.
-- hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the added sidebar configuration tests.
No open issues 🎉
What changed in this PR
Adds unit coverage for the Docusaurus sidebar configuration modules so both appear in default c8 coverage reports. No production code changes.
Changes:
- Imports both sidebar modules directly in new unit tests.
- Asserts the exported
docSidebarandanalysesSidebarautogenerated configurations.
| File | Description |
|---|---|
lib/sidebarsAnalyses.test.mts |
Verifies the exported analyses sidebar configuration. |
lib/sidebars.test.mts |
Verifies the exported documentation sidebar configuration. |
Review effort: Balanced
Test Improvement
sidebars.tsandsidebarsAnalyses.tsare imported bydocusaurus.config.ts's docs preset and analyses plugin respectively, butno unit test imported either one. c8's default report mode (the one
npm run test:coverageuses - no--allflag) only instruments files atest process actually requires, so both files were silently absent from
the coverage report rather than scored 0%, and the 99/97/100 threshold
gate had nothing to fail on. They are exercised end-to-end
(
e2e/linkRewrite.test.mjsruns a realdocusaurus buildthattransitively imports both), so the gap was unit-coverage visibility, not
a reachability gap.
This PR adds:
lib/sidebars.test.mts- importssidebars.tsdirectly and asserts itsexported
docSidebarshape.lib/sidebarsAnalyses.test.mts- importssidebarsAnalyses.tsdirectlyand asserts its exported
analysesSidebarshape.No production code changes. Files touched: two new test files only.
Verified locally:
npm run test:coveragenow reports 100% stmts/branch/func/line for both files (74 tests total, up from 72), and both now appear
in the default (non
--all) c8 report where they were previously absent.Related Issue
No tracking issue: the hive's issue-consolidation logic matched this
finding by component tag (
docusaurus.config.ts) into #425,which covers a different, unrelated gap (deploy-preview e2e wiring).
Clarified on #425 directly rather than mislabeling this PR against it.
Filed by quality agent (hold-gated mode). Human review required.
-- hive: agent=quality backend=copilot model=claude-opus-4-6 copilot=1.0.88