Repository navigation
test: cover docusaurus.config.ts markdown preprocessor - #404
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
Adds lib/docusaurusConfigPreprocessor.test.mts, exercising both branches of the inline markdown.preprocessor function (root README.md import vs. pass-through) directly against the real docusaurus.config.ts. docusaurus.config.ts imports its ./lib/* helpers without file extensions, which only Docusaurus's own webpack bundler resolves — node --experimental-strip-types --test fails with ERR_MODULE_NOT_FOUND on a direct import. lib/testHelpers/resolveExtensionlessTs.mjs is a test-only Node module-resolution hook (registerHooks) that falls back to <specifier>.ts / <specifier>/index.ts, so the test can import the real config file without any change to its production imports. Because docusaurus.config.ts also contains several unrelated, env-dependent branches (isProd/DEPLOY_PRIME_URL ternaries) that this test does not and should not target, package.json's test:coverage excludes docusaurus.config.ts and lib/testHelpers/** from the --check-coverage thresholds added in #403, so the existing 97%+ branch/line/function/statement gate keeps passing. 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. |
d9b8476
ℹ️ Sentinel notice — informational; author is trusted (hive agent), merge is not blockedHive flagged this PR (author @hivecommons-hive[bot], head
Hive did not add the |
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Reviewed by Reviewer notesRead the tree at head Verified:
Two notes, neither a defect:
No findings. A maintainer can take this at face value. |
Test Improvement
Adds
lib/docusaurusConfigPreprocessor.test.mts, exercising both branchesof the inline
markdown.preprocessorfunction indocusaurus.config.ts(root
README.mdimport that strips.mdfrom site-absolute/docs|analyses/...links, and the pass-through case for every otherimported file).
docusaurus.config.tsimports its./lib/*helpers without fileextensions, which only Docusaurus's own webpack bundler resolves — importing
it directly under
node --experimental-strip-types --testpreviouslyfailed with
ERR_MODULE_NOT_FOUND.lib/testHelpers/resolveExtensionlessTs.mjsis a small test-only Node module-resolution hook (
node:module'sregisterHooks) that falls back to<specifier>.ts/<specifier>/index.ts,so the test can import the real
docusaurus.config.tsand call its realpreprocessor— no change to any production import statement, and noextraction of the regex into a new
lib/module.Because
docusaurus.config.tsalso has several unrelated, env-dependentbranches (
isProd/DEPLOY_PRIME_URLternaries) this test doesn't target,package.json'stest:coveragenow excludesdocusaurus.config.tsandlib/testHelpers/**from the--check-coveragethresholds added in #403,so the existing 97%+ branch/line/function/statement gate keeps passing
(verified locally:
npm run test:coveragestill reports 100% across allfour metrics for every included file).
Related Issue
Fixes #398
— hive: agent=quality backend=copilot model=claude-opus-4-6 copilot=1.0.88