myscript/iinkts/write-unit-test
Claude Code and agent skill by myscript/iinkts
- community
Checking that the SKILL.md file is still in the repository.
Workflow for adding Jest unit tests to iinkTS. Use when creating tests for new or existing src/ files. Complements the `testing-patterns` skill (patterns reference). This skill covers the workflow; the `testing-patterns` skill covers the API reference.
Install
npx vskill@latest install myscript/iinkts/write-unit-testSKILL.md
Write Unit Test
Workflow
1. Find the mirror path
Test file = test/unit/ + same path as src/:
If the test file doesn't exist yet, create it. Never put tests elsewhere.
2. Load the patterns reference
Before writing, invoke the testing-patterns skill for:
- Mock setup (Canvas, WebSocket, fetch)
- Standard describe/it structure
- Available mocks:
createCanvasMock/asCanvas,InteractiveInkSSRCanvasMock,CanvasEventMock,ServerWebSocketMock, etc.
3. Structure the test file
4. Cover minimum cases per function
For every public function/method:
- ✅ Nominal — valid input, expected output
- ✅ Error — invalid/null/undefined input
- ✅ Edge — empty array, zero, boundary values
- ✅ Side effects — if the function mutates state or emits events
5. Coverage check
Target: ≥80% branches, functions, lines for new files.
Full suite check before commit:
Quick Rules
- No `any` in tests — type your mocks explicitly
- No implementation details — test behavior, not internals
- Isolate — each test should pass independently (no shared mutable state between tests)
- Mock at boundaries — mock Canvas, WebSocket, fetch. Never mock the class under test itself.
- One assertion focus per test — multiple
expectOK if they describe one behavior
See Also
The testing-patterns skill — full mock API reference, WebSocket patterns, Playwright E2E patterns.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/write-unit-test/SKILL.md
Popularity
- Repository stars
- 99
- Repository forks
- 16
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/myscript/iinkts/write-unit-test)