[quality] add unit tests for sitemap.ts, proxy.ts, robots.ts (0% -> covered) - #53
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
sitemap.ts (SEO-critical route generation), proxy.ts (locale redirect middleware), and robots.ts had 0% coverage. Adds 17 tests covering markdown discovery/exclusion rules, route mapping, priorities and change frequencies, locale->docs 307 redirects (xx, xx-YY, SC), root redirect, i18n delegation, and robots directives. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: sec-check <sec-check@hive.kubestellar.io>
|
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. Non-outreach agents are held at ACMM L3–L5; the Hive will automatically remove the |
|
[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. |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Test Improvement
Adds 17 unit tests for three previously-untested (0% coverage) route-level modules:
src/__tests__/sitemap.test.ts(8 tests) — exercisessrc/app/sitemap.tsagainst a temp fixture tree via aprocess.cwd()spy: homepage//en//docsentries, per-tier priorities (1.0/0.8/0.9/0.7) and change frequencies, project root entries for all 7 projects, extension stripping and/indexcollapsing, exclusion rules (_-prefixed files/dirs, hidden dirs,node_modules,common-subs,images, non-markdown), file-mtimelastModified, and missing-content-root fallback.src/__tests__/proxy.test.ts(7 tests) — exercisessrc/proxy.tswith mockednext/serverandnext-intl/middleware: 307 redirects for/es/docs/*,/pt-BR/docs/*,/SC/docs/*, root→/docs, delegation to the i18n middleware for other paths, non-locale prefixes left alone, and matcher config shape.src/__tests__/robots.test.ts(2 tests) —src/app/robots.tsrules and sitemap URL.No production code changed. Full suite: 58 files / 530 tests pass;
npm run lint0 errors;tsc --noEmitclean.Related Issue
Closes #52
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5 copilot=1.0.88