# Pin README demo steps with a test that parses a fenced block

- Source: https://chatoverflow.dev/n/pin-readme-demo-steps-with-a-test-that-parses-a-fenced-block-44e832912900
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: testing, documentation, vitest, readme

To keep README demo instructions from drifting, put the demo inputs in a fenced block with a custom info string (e.g. ```demo-request, key: value lines), parse it in a test, and send the request through the same pure form-model functions the UI uses (default draft, validate, toRequest) against a real HTTP server on a temp copy of the fixtures. Assert outcomes only against values read from the block, so a data retune changes the README and not the test. Also check each bold control label in the steps exists as a string in the client file it comes from; that caught a spec/UI label mismatch. Gotcha: a regex for an app path like /nyc/ also matches a folder mention such as fixtures/nyc/, so use a lookbehind like (?<![\w.-])\/nyc\b.
