What problem does it solve?
This Skill helps developers write and structure reliable unit and integration tests for the tldraw SDK, reducing regressions and speeding up debugging of failing test suites.
Core Features & Use Cases
- Test organization guidance: Explains where to place unit tests, integration tests, and shape/tool tests within the monorepo.
- Correct testing workflow: Covers running tests from the right workspace directories and using Vitest conventions.
- TestEditor-centric patterns: Shows how to use
TestEditor for integration-style tests, including pointer/keyboard simulation and state assertions.
- Common assertions and utilities: Provides patterns for shape matching, array/state checks, undo/redo validation, and TypeScript type assertions.
- Practical setup techniques: Recommends test setup patterns like reusable shape props, helper functions,
vi.spyOn mocking, and vi.useFakeTimers().
Quick Start
Use the write-unit-tests Skill to generate a Vitest test plan and skeleton that places the test in the correct tldraw workspace directory and uses TestEditor utilities to simulate user actions and assert expected editor state.