test

Write or run vitest tests for tRPC routers and Zod schemas.

Updated May 23, 2026
One-click install
npx skills add https://github.com/devturco/thiago-dev-template --skill test-devturco
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test
Source: https://github.com/devturco/thiago-dev-template/tree/main/.claude/skills/test
Command: npx skills add https://github.com/devturco/thiago-dev-template --skill test-devturco

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you add or verify automated tests so changes don’t silently break existing behavior and assumptions.

Core Features & Use Cases

  • Writes or runs targeted tests: Test a specific file or feature instead of the whole suite.
  • Supports a consistent testing approach: Uses vitest with @testing-library/react and encourages boundary mocking (db and external APIs).
  • Covers common stack surfaces: Includes patterns for tRPC caller/router tests and Zod schema input validation.

Quick Start

Run the test skill to write or execute tests for the file or feature you specify (for example, the module you just changed).

Frequently Asked Questions about test

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

FAQPage Schema
How do I write regression tests for tRPC routers using vitest?

To write automated tests for tRPC routers using vitest, you invoke the caller directly and assert behavior outcomes while mocking database and external API boundaries. This prevents regressions by validating router logic and Zod schema inputs in isolation.

What is the best way to test Zod schema input validation in a tRPC stack?

Testing Zod schema input validation involves passing varied data shapes to your procedures and asserting acceptance or rejection. This behavior-focused approach verifies schema enforcement and prevents silent regressions when input structures change.

Does this testing approach support React components with @testing-library/react?

Yes, this testing approach supports React components using @testing-library/react conventions. It encourages behavior-focused assertions and boundary mocking, ensuring UI tests validate actual user interactions and component behavior rather than internal implementation details.

How do I run targeted tests for a specific file instead of the whole suite?

You run targeted tests for a specific file by specifying the changed module when executing the test command. This validates only the specified feature instead of running the entire suite, saving time and providing immediate feedback on recent changes.

Why should I mock database and external API boundaries in automated tests?

Mocking database and external API boundaries isolates the code under test to prevent external dependencies from causing flaky results. This ensures automated tests remain consistent, behavior-focused, and reliable for preventing regressions in your stack.