Skip to content

test(docs): check that doc links, commands and flags exist - #74

Open
scott-lowe-vapi wants to merge 1 commit into
fix/cleanup-honor-vapi-ignorefrom
test/docs-integrity
Open

scott-lowe-vapi wants to merge 1 commit into
fix/cleanup-honor-vapi-ignorefrom
test/docs-integrity

Conversation

@scott-lowe-vapi

@scott-lowe-vapi scott-lowe-vapi commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Value

V.A.L.U.E. tier: micro — tests only; 2 new test files; no blast-radius path; the tests are the deterministic check.

  • Problem: the docs are about to get much more traffic (linked from Vapi's docs), and the last few PRs moved a lot of them. Nothing stopped a broken relative link, a stale anchor, or a command that no longer exists (npm run <script>, --flag) from shipping.
  • Who it affects: new users following the README and guides, and coding agents that run the commands the docs show.
  • What changes:
    • tests/docs-links.test.ts: every relative link and #anchor in the root *.md, docs/** and examples/** must resolve, ignoring code blocks.
    • tests/docs-commands.test.ts: every npm run <x> in the docs must be a package.json script, and every --flag shown with a command must exist in src/. improvements.md is excluded because it records historical behavior; --allow-unrelated-histories is allowed as a git flag.

Evidence of value

Mutation Result
Rename a heading that a link targets links test fails, naming the file and anchor
Rename a package.json script commands test fails, naming the doc and script
Rename a CLI flag in src/ commands test fails, naming the doc and flag
Current docs both pass (more than 20 files checked)

Testing plan

  • npm test (505 tests at this commit) and npx tsc --noEmit pass.
  • Not tested: external https:// links, which would make the suite network-dependent.

Refs TEST-141

🤖 Generated with Claude Code

The README now links into eight guides that link to each other, and the
docs name many commands and flags. Nothing checked either: renaming a
heading, a script or a flag would leave the docs quietly wrong.

- tests/docs-links.test.ts: every relative link and #anchor in the
  root markdown files, docs/ and examples/ resolves (GitHub's heading
  anchor rules, code blocks ignored).
- tests/docs-commands.test.ts: every `npm run <x>` in the docs is a
  package.json script, and every documented --flag (after `npm run` on
  the same line, or on its own in inline code) appears in src/. Flags of
  other tools are allow-listed, and improvements.md is skipped as a
  historical log.

Each test fails when a heading, a script or a flag is renamed (checked by
breaking one of each).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant