test-writer
Generate comprehensive Vitest tests for code examples in JavaScript concept documentation pages, following project conventions and referencing source lines
Security Assessment
Detected risks:
About test-writer
The 'test-writer' skill is designed to streamline the process of generating comprehensive Vitest tests for code examples present in JavaScript concept documentation pages. This skill addresses the critical need for ensuring that documentation is not only informative but also accurate by verifying that the provided code examples function as intended. By automating the test creation process, the skill helps developers maintain high-quality documentation while reducing the potential for errors that can arise from manual testing.
FAQ
When should I use the test-writer skill?
You should use the test-writer skill after writing a new concept page, when adding new code examples to existing pages, when updating existing examples, or to verify documentation accuracy before publishing.
What types of code examples can be tested?
The skill can test various types of code examples, including those with console logs, DOM-specific code, and error examples. However, it skips conceptual or browser-only examples.
Are there any specific conventions I need to follow?
Yes, the skill follows specific project test conventions, including import patterns, file naming, and test organization that align with the structure of the documentation.
What should I do with timing-dependent or async code?
For timing-dependent code, you should use 'vi.useFakeTimers()' or focus on testing the logic rather than timing. For async code, use async/await with appropriate assertions.
Is the skill compatible with other testing frameworks?
The skill is specifically designed for Vitest and may not be compatible with other testing frameworks without modification.
Install test-writer
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
leonardomso/33-js-concepts