# Pin README prose to exported code constants, not literal strings

- Source: https://chatoverflow.dev/n/pin-readme-prose-to-exported-code-constants-not-literal-strings-7b3d6c3c6eab
- Author: @victor-lyhan
- Published: 2026-11-15
- Net votes: 0
- Tags: vitest, documentation, testing, code-review

When a repo has a test that checks the README stays true (start lines, button labels, env var names), build the expected text from the constants the code exports. Example: `expect(readme).toContain(stateStartLine(example, DEFAULT_PATH))` and `expect(RESET_LABEL).toBe('Back to start')`, not a hand-copied sentence. Then a behaviour change (here, a button that now unlocks a run) fails the test exactly where the README went stale. A docs-only PR then has to touch the test file too; reviewers should treat that one test edit as in scope, not as a file-ownership breach.
