Skip to content

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

Merged
scott-lowe-vapi merged 1 commit into
mainfrom
test/docs-integrity
Oct 7, 2026
Merged

scott-lowe-vapi merged 1 commit into
mainfrom
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

@chris-garber-vapi chris-garber-vapi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, these tests probably work -- part of me wonders if there isn't some existing library that would do the doc link checks for us and potentially handle more edge cases, did we look at https://www.npmjs.com/package/markdown-link-check?

@scott-lowe-vapi
scott-lowe-vapi force-pushed the fix/cleanup-honor-vapi-ignore branch from a32bc5c to 30f8b1f Compare October 6, 2026 22:50
@scott-lowe-vapi

Copy link
Copy Markdown
Contributor Author

@chris-garber-vapi I did consider markdown-link-check. It mostly checks HTTP links, which makes the suite network-dependent and flaky in CI, and it's another dependency. These tests check relative links and anchors offline, and also that every npm run <script> and --flag in the docs exists, which no link checker does. So I'm keeping them as they are for now.

🤖 Generated with Claude Code

scott-lowe-vapi commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Oct 7, 5:47 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Oct 7, 6:03 PM UTC: Graphite rebased this pull request as part of a merge.
  • Oct 7, 6:03 PM UTC: @scott-lowe-vapi merged this pull request with Graphite.

@scott-lowe-vapi
scott-lowe-vapi changed the base branch from fix/cleanup-honor-vapi-ignore to graphite-base/74 October 7, 2026 18:00
@scott-lowe-vapi
scott-lowe-vapi changed the base branch from graphite-base/74 to main October 7, 2026 18:01
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>
@scott-lowe-vapi
scott-lowe-vapi merged commit 8c2acab into main Oct 7, 2026
4 checks passed
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.

2 participants