Testing dependencies are scoped to tests/ (or tools/ in some workflows) so root docs setup is not changed.
cd tests
npm installnpm install -g puppeteer @cspell/dict-en-gb cspell js-yamlnode tests/run-all.jsRuns unit + integration suite.
-
node tests/unit/style-guide.test.js -
node tests/unit/mdx.test.js -
node tests/unit/spelling.test.js -
node tests/unit/quality.test.js -
node tests/unit/links-imports.test.js -
node tests/unit/docs-navigation.test.jsChecks docs.json route integrity in non-writing mode by default. -
node tests/unit/docs-navigation.test.js --write-reportExplicitly refreshes:tasks/reports/navigation-links/navigation-report.mdtasks/reports/navigation-links/navigation-report.json
-
node tests/unit/docs-guide-sot.test.js -
node tools/scripts/generate-pages-index.js -
node tools/scripts/enforce-generated-file-banners.js --check
-
node tests/integration/browser.test.jsBrowser rendering checks (local server flow). -
node tests/integration/domain-pages-audit.jsDomain load audit against deployed docs URLs. -
node tests/integration/v2-link-audit.jsComprehensive static link/import audit for allv2/pagesMDX files and recursively imported MDX dependencies. Excludes anyx-*path segments underv2/. Generates:tasks/reports/navigation-links/LINK_TEST_REPORT.mdtasks/reports/navigation-links/LINK_TEST_REPORT.json- Domain link maps at
snippets/data/<domain>/hrefs.jsxin full mode when write-links is enabled.
-
node tests/integration/v2-wcag-audit.jsHybrid v2 accessibility audit for filesystem docs pages underv2/(excluding anyx-*directories). Runs conservative static checks/autofix on all selected files and browser-rendered WCAG checks (axe-core) on routable pages. Generates deterministic reports (overwritten each run) at:tasks/reports/quality-accessibility/v2-wcag-audit-report.mdtasks/reports/quality-accessibility/v2-wcag-audit-report.json
-
node tests/integration/openapi-reference-audit.jsOpenAPI endpoint integrity audit forv2/**including locales (v2/es,v2/fr,v2/cn). Validates frontmatteropenapi: METHOD /pathand<OpenAPI ...>references against canonical local specs (api/studio.yaml,api/openapi.yaml,api/cli-http.yaml). Workflow trigger surface:- PRs to
mainanddocs-v2(blocking) - pushes to
mainanddocs-v2(blocking after autofix attempt) - scheduled daily run at
04:35 UTC - manual
workflow_dispatchAutofix boundaries: - only deterministic normalization (
METHODcasing, spacing, leading slash) - no semantic endpoint guess/rewrites Rolling issue behavior:
- single marker issue
<!-- openapi-reference-audit --> - opens/updates on unresolved failures
- comments and closes automatically when resolved
- PRs to
Triage flow for endpoint-not-found-in-spec:
- Confirm mapped spec using file path scope (Studio/AI/CLI-HTTP map).
- Search spec path+method in mapped spec.
- If endpoint moved/renamed, update page
openapiand<OpenAPI path=...>together. - If endpoint is intentionally removed, remove/retire the docs page from navigation (
docs.json) and locale variants. - Re-run strict audit and confirm zero unresolved findings.
Flags:
--stagedonly checks staged docs pages--files <path[,path...]>only checks explicit docs page files (repeatable)--base-url <url>sets target domain (default:https://docs.livepeer.org)--version v1|v2|bothfilters scope (default:both)- Link audit flags:
--full(default)--staged--files <path[,path...]>(repeatable)--report <path>(default:tasks/reports/navigation-links/LINK_TEST_REPORT.md)--report-json <path>(default:tasks/reports/navigation-links/LINK_TEST_REPORT.json)--write-links(default: true in full mode, false in staged/files mode)--no-write-links--strict(exit non-zero on missing internal links/imports)--external-policy classify|validate(default:classify)--external-link-types navigational|media|all(default:navigational)--external-timeout-ms <int>(default:10000)--external-concurrency <int>(default:12)--external-per-host-concurrency <int>(default:2)--external-retries <int>(default:1)- Advisory behavior note: external validation does not affect strict internal-link failures.
- WCAG audit flags:
--full(default)--staged--files <path[,path...]>(repeatable)--fix/--no-fix(default:--fix)--stage(stage autofixed content files)--max-pages <n>(cap browser-audited pages)--base-url <url>(otherwise local server manager is used)--fail-impact <critical|serious|moderate|minor|none>(default:serious)--report <path>/--report-json <path>
- OpenAPI audit flags:
--full(default)--files <path[,path...]>(repeatable)--strict(exit non-zero on findings)--fix --write(conservative normalization only)--report <path>/--report-json <path>
Report output (same file each run, overwritten):
tests/reports/domain-page-load-report.jsontasks/reports/quality-accessibility/v2-wcag-audit-report.mdtasks/reports/quality-accessibility/v2-wcag-audit-report.json
WCAG coverage note:
- Automated WCAG checks are partial coverage and do not replace manual accessibility review (keyboard UX, screen-reader flows, content meaning, and task-based testing).
color-contrastfindings are advisory-only (non-blocking) in the WCAG audit until color updates are approved.
node tests/run-all.js
node tests/run-all.js --wcagnode tests/integration/domain-pages-audit.js --version both
node tests/integration/domain-pages-audit.js --version v1
node tests/integration/domain-pages-audit.js --version v2
node tests/integration/domain-pages-audit.js --staged --version both
node tests/integration/domain-pages-audit.js --base-url https://docs.livepeer.org --version both
node tests/integration/v2-link-audit.js --full --write-links
node tests/integration/v2-link-audit.js --staged --strict --report /tmp/livepeer-link-audit-staged.md
node tests/integration/v2-link-audit.js --files v2/community/livepeer-community/trending-topics.mdx --strict
node tests/integration/v2-link-audit.js --full --external-policy validate --external-link-types navigational --no-write-links --report /tmp/v2-link-audit-external.md --report-json /tmp/v2-link-audit-external.json
node tests/integration/v2-wcag-audit.js --full
node tests/integration/v2-wcag-audit.js --full --no-fix
node tests/integration/v2-wcag-audit.js --staged --fix --stage --max-pages 10 --fail-impact serious --report /tmp/livepeer-wcag-audit-precommit.md --report-json /tmp/livepeer-wcag-audit-precommit.json
node tests/integration/openapi-reference-audit.js --full --strict --report /tmp/openapi-audit.md --report-json /tmp/openapi-audit.json
node tests/integration/openapi-reference-audit.js --full --fix --write --report /tmp/openapi-audit-fix.md --report-json /tmp/openapi-audit-fix.json
node tests/integration/openapi-reference-audit.js --files v2/solutions/livepeer-studio/api-reference/streams/create.mdx --strict
bash lpd test --staged --wcag
bash lpd test --staged --link-audit-external
bash lpd test --full --wcag
bash lpd test --full --link-audit-external
bash lpd test --full --wcag --wcag-no-fix
bash lpd tools wcag-repair-common -- --staged --stage
node tests/run-pr-checks.js --base-ref mainnpm --prefix tests run test
npm --prefix tests run test:style
npm --prefix tests run test:mdx
npm --prefix tests run test:spell
npm --prefix tests run test:quality
npm --prefix tests run test:links
npm --prefix tests run test:docs-nav
npm --prefix tests run test:docs-nav:write
npm --prefix tests run test:pr
npm --prefix tests run test:docs-guide
npm --prefix tests run test:pages-index
npm --prefix tests run test:pages-index:write
npm --prefix tests run test:pages-index:rebuild
npm --prefix tests run test:generated-banners
npm --prefix tests run test:browser
npm --prefix tests run test:openapi:audit
npm --prefix tests run test:openapi:issue
npm --prefix tests run test:link-audit
npm --prefix tests run test:link-audit:staged
npm --prefix tests run test:link-audit:external
npm --prefix tests run test:link-audit:unit
npm --prefix tests run test:link-audit:selftest
npm --prefix tests run test:domain
npm --prefix tests run test:domain:v1
npm --prefix tests run test:domain:v2
npm --prefix tests run test:domain:both
npm --prefix tests run test:wcag
npm --prefix tests run test:wcag:staged
npm --prefix tests run test:wcag:nofix
npm --prefix tests run test:wcag:unit
npm --prefix tests run test:wcag:selftest.github/workflows/test-suite.ymlruns changed-file scoped blocking checks on pull requests:- style guide, MDX, spelling, quality, links/imports
- script docs enforcement on changed scripts (
tests/unit/script-docs.test.js --files ...) - strict V2 link audit on changed docs pages (
tests/integration/v2-link-audit.js --files ... --strict)
- Integration PR exception: for
docs-v2 -> main, changed-file static failures are advisory while browser failures remain blocking. - The same workflow also runs full browser tests from
docs.json. .github/workflows/test-v2-pages.ymlis responsible for PR comments and artifact uploads for V2 browser sweep results..github/workflows/broken-links.ymlis currently advisory (non-blocking) while legacy link cleanup is in progress..github/workflows/v2-external-link-audit.ymlruns nightly advisory external-link validation for fullv2scope (excludingx-*paths).- Full matrix:
tests/PR-CI-TESTS-AND-SCRIPT-RUN-MATRIX.md
- Pre-commit runs
tests/run-all.js --staged --skip-browserin fast mode. - Docs navigation checks in this flow are check-only and do not rewrite
tasks/reports/navigation-links/navigation-report.*. - Pre-commit also runs domain audit on staged docs pages:
node tests/integration/domain-pages-audit.js --staged --base-url https://docs.livepeer.org --version "$DOMAIN_AUDIT_VERSION" - Pre-commit runs staged WCAG accessibility audit (conservative autofix enabled by default, blocks on remaining
serious/criticalissues):node tests/integration/v2-wcag-audit.js --staged --fix --stage --max-pages 10 --fail-impact serious --report /tmp/livepeer-wcag-audit-precommit.md --report-json /tmp/livepeer-wcag-audit-precommit.json - Pre-commit runs staged V2 link audit (strict internal validation, external classify-only):
node tests/integration/v2-link-audit.js --staged --strict --report /tmp/livepeer-link-audit-precommit.md - Set
DOMAIN_AUDIT_VERSION=v1|v2|bothto control scope in pre-commit. - Pre-commit enforces script header docs for newly added scripts and auto-updates script indexes:
node tests/unit/script-docs.test.js --staged --write --stage --autofillMissing headers are auto-inserted, then commit remains blocked until placeholder values are filled. - Pre-commit also synchronizes
v2/pagesindex files:node tools/scripts/generate-pages-index.js --staged --write --stageThis regenerates top-level sectionindex.mdxfiles, updates rootv2/pages/index.mdx, marks missingdocs.jsonpages with⚠️, and removes nestedindex.mdx/index.mdfiles.
Newly added scripts must include these tags near the top of the file:
@script@summary@owner@scope@usage@inputs@outputs@exit-codes@examples@notes
Example:
/**
* @script domain-pages-audit
* @summary Audit deployed docs page load status.
* @owner docs
* @scope tests/integration, tests/reports
*
* @usage
* node tests/integration/domain-pages-audit.js --version both
*
* @inputs
* --version v1|v2|both (default: both)
* --base-url <url> (default: https://docs.livepeer.org)
*
* @outputs
* - tests/reports/domain-page-load-report.json
*
* @exit-codes
* 0 = success
* 1 = failures or invalid config
*
* @examples
* node tests/integration/domain-pages-audit.js --staged --version v2
*
* @notes
* Overwrites the same report file each run.
*/Use the generator to create a new script with header already attached:
node tools/scripts/new-script.js --path tools/scripts/my-script.js
node tools/scripts/new-script.js --path tasks/scripts/my-script.sh --owner docs --scope tasks/scripts{/* SCRIPT-INDEX:START */}
| Script | Summary | Usage |
|---|---|---|
tests/integration/domain-pages-audit.js |
Audit deployed docs page load status and emit a stable JSON report. | node tests/integration/domain-pages-audit.js --version both |
tests/run-pr-checks.js |
Run changed-file scoped validation checks for pull request CI. | node tests/run-pr-checks.js --base-ref main |
tests/integration/v2-link-audit.js |
Comprehensive V2 MDX link audit with internal strict checks and optional external URL validation. | node tests/integration/v2-link-audit.js --full --write-links --strict |
tests/unit/v2-link-audit.test.js |
Unit tests for v2 link audit args, external validation helpers, and x-* scope exclusion behavior. | node tests/unit/v2-link-audit.test.js |
tests/integration/v2-link-audit.selftest.js |
Script-level self-tests for v2 link audit external validation using a local HTTP fixture and temporary MDX file. | node tests/integration/v2-link-audit.selftest.js |
tests/unit/script-docs.test.js |
Enforce script header schema, keep group script indexes in sync, and build aggregate script index. | node tests/unit/script-docs.test.js --staged --write --stage --autofill |
| {/* SCRIPT-INDEX:END */} |