write-unit-tests

Write and maintain Vitest unit and integration tests for the tldraw SDK.

Updated Feb 6, 2026
One-click install
npx skills add https://github.com/seflless/tldraw-agent-claude-code-provider --skill write-unit-tests-seflless
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-unit-tests
Source: https://github.com/seflless/tldraw-agent-claude-code-provider/tree/main/.claude/skills/write-unit-tests
Command: npx skills add https://github.com/seflless/tldraw-agent-claude-code-provider --skill write-unit-tests-seflless

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Unit and integration testing is essential for maintaining the quality of the tldraw SDK, preventing regressions, and documenting expected behavior.

Core Features & Use Cases

  • Vitest-based unit and integration test patterns across core primitives, editors, and shapes.
  • TestEditor usage, reusable test helpers, and organized test files near source code in packages/editor and packages/tldraw.
  • Clear guidance for structuring unit vs integration tests and writing robust assertions.

Quick Start

Create unit tests next to source files and run the workspace test suite to verify changes.

Frequently Asked Questions about write-unit-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write unit tests for the tldraw SDK using Vitest?

To write unit tests for the tldraw SDK using Vitest, place test files next to source code within packages/editor and packages/tldraw. This co-location strategy ensures maintainable test suites and reliable execution across core primitives.

What is the difference between unit and integration tests in tldraw?

Unit tests in tldraw isolate core primitives and shapes, while integration tests leverage TestEditor patterns to verify editor behaviors. Structuring them separately near source code maintains reliable assertions and prevents regressions across packages.

Does writing tests for tldraw require the TestEditor pattern?

Writing robust integration tests for tldraw requires the TestEditor pattern to simulate editor scenarios. Unit tests for isolated primitives do not require TestEditor, allowing developers to validate specific logic without initializing the full editor environment.

What is the best way to structure Vitest test files in a tldraw project?

The best way to structure Vitest files in a tldraw project is placing them next to source files in packages/editor and packages/tldraw. This organized placement next to source code ensures reliable, maintainable test suites.

Why do my tldraw unit tests fail when updating packages?

Unit tests fail when updating tldraw packages if assertions are not robust or integration scenarios change. Using Vitest patterns and reusable test helpers within TestEditor ensures reliable coverage and prevents regressions during updates.