Install any skill in seconds. Free to start, no credit card required.
Get Started Free →tldraw/write-unit-tests
Writing unit and integration tests for the tldraw SDK.
Passed 22 of 23 test cases with the skill, and 12 of 23 without it.
and 11 more in the full report
10 fixed12 passed either way1 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
This benchmark measured an earlier version of the skill.
A newer attempt on gemini-3.8-flash on 10/18/2026 did not produce a publishable comparison (not comparable). The snapshot above is the previously measured run.
One of 10 test cases the skill fixed. Same model, same prompt, with and without the skill.
I am working inside the packages/tldraw workspace directory and want to run only the unit tests that match the keyword 'SelectTool' once without staying in watch mode. What terminal command should I execute?
| Checked | Without skill | With skill |
|---|---|---|
| The command uses yarn test run --grep "SelectTool". | Missed | Passed |
The instructions your model reads when the skill loads.
Unit and integration tests use Vitest and run from workspace directories, not the repo root.
Read a neighboring test before writing a new one — the existing suites are the specification for how we test, and they stay current in a way prose can't. Good starting points:
packages/tldraw/src/test/SelectTool.test.ts — tool state machine assertionspackages/tldraw/src/test/resizing.test.ts — pointer-driven interaction with handlespackages/tldraw/src/lib/shapes/arrow/ArrowShapeUtil.test.ts — shape util plus bindingspackages/editor/src/lib/editor/managers/ClickManager/ClickManager.test.ts — a UI-free managerpackages/editor/src/lib/primitives/Vec.test.ts — a plain primitiveFor the available TestEditor methods, read the class itself rather than a list here: packages/tldraw/src/test/TestEditor.ts.
packages/editor — core primitives, geometry, managers, base editor behavior that must not depend on default shapes or UI.packages/tldraw — anything needing default shapes or tools, which is most integration tests.Each package has its own TestEditor, and they are not interchangeable: packages/editor/src/lib/test/TestEditor.ts has no default shapes or tools, packages/tldraw/src/test/TestEditor.ts wires up the full SDK. Import from the package you're testing in.
cd packages/tldraw && pnpm test run
cd packages/tldraw && pnpm test run -t "SelectTool"
cd packages/tldraw && pnpm test # watch mode
Unit tests sit next to the file they cover (Vec.ts → Vec.test.ts). Cross-cutting integration tests live in packages/tldraw/src/test/. Shape and tool tests sit with the implementation, not in src/test/.
These are the things reading an existing test won't tell you.
Wheel and pinch events are batched. dispatch() alone won't apply them — emit a tick to flush:
editor.dispatch(wheelEvent)
editor.emit('tick', 16)
test cases passed, vs 12 / 23 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.