write-unit-tests

Automate unit and integration tests for the tldraw SDK using Vitest.

49.7k|3.4k|Updated May 9, 2021
One-click install
npx skills add https://github.com/tldraw/tldraw --skill write-unit-tests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-unit-tests
Source: https://github.com/tldraw/tldraw/tree/main/.claude/skills/write-unit-tests
Command: npx skills add https://github.com/tldraw/tldraw --skill write-unit-tests

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing unit and integration tests for the tldraw SDK can be time-consuming and error-prone. This Skill provides structured guidance and patterns to implement tests effectively, ensuring changes in editor and tldraw packages are reliably validated.

Core Features & Use Cases

  • Vitest-based testing patterns aligned with the tldraw codebase
  • TestEditor usage guidance and examples for common scenarios
  • Test file organization recommendations (unit tests alongside source, integration tests under test directories)

Quick Start

Create tests following the Vitest patterns and TestEditor usage described above and run the repository's standard test commands.

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?

Organize tldraw SDK unit tests by placing them alongside source files and using Vitest patterns. Integration tests belong under dedicated test directories to ensure reliable validation of editor packages.

What is the best way to use TestEditor for tldraw integration testing?

Use TestEditor within Vitest to simulate common scenarios and verify tldraw editor behavior. Follow standard test layout guidelines to ensure consistent integration testing across packages.

Does the tldraw SDK require Vitest for test automation?

Yes, tldraw SDK test automation requires Vitest and the repository's testing utilities to execute unit and integration tests across the editor and tldraw packages.

How should I organize test files in the tldraw repository?

Keep unit tests alongside source files and integration tests under test directories. This standard layout allows running all tldraw tests through a unified repository command.

Why are my tldraw editor tests failing to validate SDK behavior?

Your tldraw editor tests may fail if they lack the required Vitest setup and repository testing utilities. Ensure TestEditor usage aligns with standard patterns to properly verify SDK behavior.