write-unit-tests

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

90|4|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/aisa-group/skill-inject --skill write-unit-tests-aisa-group
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-unit-tests
Source: https://github.com/aisa-group/skill-inject/tree/main/data/skills/write-unit-tests
Command: npx skills add https://github.com/aisa-group/skill-inject --skill write-unit-tests-aisa-group

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing unit and integration tests for the tldraw SDK can be tedious and error-prone without established patterns. This skill provides guidance on where tests live, how to organize them, and how to leverage Vitest to ensure consistent coverage across editor and runtime packages.

Core Features & Use Cases

  • Test organization: Place unit tests beside source files and integration tests in designated test directories for groups like packages/editor and packages/tldraw.
  • Standard patterns: Reuse TestEditor examples, shape utilities, and common test helpers to speed up test authoring.
  • Quality assurance: Establish clear guidelines for test naming, expectations, and maintenance to improve reliability and reduce regressions.

Quick Start

Run the test suite for the tldraw workspace using the project’s test command.

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, place test files beside source files and leverage standard patterns like TestEditor examples to ensure consistent coverage and simplify maintenance.

Where should integration tests be organized in a tldraw workspace?

Integration tests should be placed in designated test directories within workspace packages like packages/editor and packages/tldraw to separate them from colocated unit tests.

What is the TestEditor pattern used for in tldraw testing?

The TestEditor pattern provides a reusable test harness for tldraw, allowing you to speed up test authoring by standardizing editor initialization and applying common shape utilities.

How do I maintain test quality and reduce regressions in tldraw packages?

Maintain test quality in tldraw packages by following established guidelines for test naming, expectations, and clear documentation to improve reliability and reduce regressions.

Does this Vitest testing approach work for both editor and runtime packages?

Yes, this approach applies tests across both packages/editor and packages/tldraw, ensuring robust coverage and standard patterns across the tldraw workspace.

Why do my tldraw integration tests fail without proper file organization?

tldraw integration tests require designated test directories and standard patterns; incorrect file placement or missing TestEditor utilities can cause inconsistent coverage and regressions.