writing-unit-tests

Generate standardized unit test templates for Rust and React projects.

Updated Feb 15, 2026
One-click install
npx skills add https://github.com/reynalivan/EMMM2 --skill writing-unit-tests-reynalivan
Or copy as Structured Prompt for Agentā–¼
Please help me install this Agent Skill.
Skill: writing-unit-tests
Source: https://github.com/reynalivan/EMMM2/tree/main/.agent/skills/writing-unit-tests
Command: npx skills add https://github.com/reynalivan/EMMM2 --skill writing-unit-tests-reynalivan

SYSTEM DOCUMENTATION & REQUIREMENTS

šŸ’” This Skill includes references (resource) components.

What problem does it solve?

Standardizes and codifies unit testing practices across Rust backend and React frontend to reduce flaky tests and ensure consistent coverage aligned with Project TRD.

Core Features & Use Cases

  • Templates for Rust logic tests, async tests with tokio, and database tests with sqlx.
  • React component and hook tests using Vitest + RTL, plus practical references for backend and frontend templates.
  • Concrete examples and conventions to accelerate onboarding and maintain testing discipline across modules.

Quick Start

Create a new test module following the provided templates and run cargo test for Rust or pnpm test for React to validate behavior.

Frequently Asked Questions about writing-unit-tests

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

FAQPage Schema
How do I write standardized unit tests for Rust backend logic and services?ā–¼

You can standardize Rust backend unit tests using provided templates for cargo test, tokio::test, and sqlx::test. These templates enforce deterministic, fast-running tests for core logic, services, and database interactions aligned with TRD guidelines.

What is the best way to set up Vitest tests for React components and hooks?ā–¼

The best way to set up Vitest tests for React is using standardized templates with RTL. These templates provide concrete examples and conventions to maintain testing discipline across frontend modules.

Can I use these testing templates for async Rust tests and database interactions?ā–¼

Yes, you can use these testing templates for async Rust tests and database interactions. The templates include concrete examples for tokio::test and sqlx::test to ensure deterministic, fast-running database and asynchronous operations.

How do I reduce flaky tests in a Rust and React full-stack project?ā–¼

To reduce flaky tests in a Rust and React project, apply codified testing practices using standardized templates. These templates enforce deterministic, fast-running tests across backend logic and frontend components to ensure consistent coverage.

How do I run and validate unit tests after creating modules from these templates?ā–¼

To run and validate unit tests after creating modules from these templates, execute cargo test for Rust backend or pnpm test for React frontend. This validates behavior across logic, services, and UI layers following the provided conventions.