Claude Code Test Writer for JavaScript Documentation Examples
Turn JavaScript tutorial examples into Vitest assertions with source-line references. Organize cases by documentation section and put examples that need browser APIs in a separate test file.
中文Install in Claude Code
Use Claude Code in the pinned 33-js-concepts checkout. Running the examples requires the repository's Node.js and Vitest dependencies.
- Open the pinned repository checkout and confirm `.claude/skills/test-writer/SKILL.md` is present.
- Start Claude Code from the repository root and call `/test-writer` with the document path and examples to cover.
Example task
Add assertions for a fictional array tutorial. The example doubles `[3, 5]` with `map` and returns `[6, 10]`. Check both the returned values and preservation of the input array.What to check
Expect a Vitest case in the matching documentation group with separate assertions for the result and original array, plus the source-line reference.
Original SKILL.md on GitHub · Updated
Frequently asked question
Should regular and DOM examples share a test file?
Use the project's `.dom.test.js` convention for examples that require jsdom and keep standard examples in `.test.js`.