ddtds doctests that don't suck
runs your code blocks as tests with your framework of choice
- parse codeblocks + tags
- build testfiles
- run with repo config
Takes advantage of existing test config instead of a separate compiler config or test config
./packageshas ddtdts library and cli code- core has agnostic logic for parsing codefences
- vitest is vitest specific logic and plugin
- cli is light glue to run it all
- e2e is tests
./exampleshas react, typescript, javascript examples
TODO verify these claims and also find more alternatives
typescript-docs-verifier typechecks with a custom config, I don't believe it allows for custom compilers so react is off the table
markdown-doctest seems pretty old looking and only works with js
Must haves
- support vitest
- CLI
- hide boilerplate (should it be # or other syntax)
- annotations (run, fail, skip)
- --max-failures to ratchet down build failures incrementally
- agent skill to aid with migration and fixing build failures (prefer adding hidden imports to compile, do not add assertions??)
- ignore config (maybe file?)
- Hoisting imports (what if conflicting? should we just rewrite to dynamic imports??? one file per test?)
- dynamic imports/relative paths
- test isolation (users ideally shouldn't be setting globals in tests, should we deal with this ourselves?)
- monorepo with multiple testing roots (I think doctest package would be best here to avoid polluting the dev deps in root)
- strip export/export default
- don't crash process on compile failure
Nice to haves
- generic template string to add generic top level imports and test func
- other framework support like node builtin support or jest
- error handling (if fails to compile, how to point at source?)
- watch mode
- JSON output for ratcheting/LLM consumption/MCP
- JSDOC stuff
- ESM vs Commonjs?
- max warnings to allow projects with build failures to crank them down
- maybe force assertions?
- pass through flags
- MDX
- md
- general larger repos
- vitest/jest
- various frameworks (react, solid, vue)