✨ Compile doc code fences into tests
Every `ts`-tagged fence in README.md / CONTRIBUTING.md now becomes an executed `node:test` case in a gitignored generated file, so a documented example cannot drift from the API. The generator hoists and merges the leading imports, rewrites the library specifier to the `#test-tiny-pattern-ts` alias, and rejects a fence with no describing paragraph or one that re-imports a prelude module. CI regenerates via `pretest:ci`; `create:doc-tests` runs the generator, formats, then typechecks the output against a scoped tsconfig that relaxes `noUnusedLocals`. c8's default excludes already omit the generated `*.test.ts`, so `test:ci` is unchanged.
This commit is contained in:
1 parent
d1963b0329
commit
30d97a9209
15 files changed
+1180
-8
No files matched your search
@@ -96,7 +96,8 @@ aggregator.
|
||||
|
||||
#### Why
|
||||
|
||||
- Both members create something real: a branch, a release.
|
||||
- Every member creates something real: a branch, a release, the compiled
|
||||
doc-tests.
|
||||
- It joined both lists in [CONTRIBUTING.md](../CONTRIBUTING.md) alongside its
|
||||
first members, so it could not go invisible the way the retired `use:` prefix
|
||||
did.
|
||||
|
||||
Reference in new issue
Block a user