unit-testing

Write unit tests with Jest, Vitest, or pytest using Arrange-Act-Assert and coverage gating.

2|Updated Apr 18, 2021
One-click install
npx skills add https://github.com/rabbicse/go-projects --skill unit-testing-rabbicse
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unit-testing
Source: https://github.com/rabbicse/go-projects/tree/main/projects/movie-ticket-booking/.claude/skills/unit-testing
Command: npx skills add https://github.com/rabbicse/go-projects --skill unit-testing-rabbicse

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you create unit tests that actually protect behavior, not just code paths, so regressions are caught early without brittle implementation checks.

Core Features & Use Cases

  • Behavior-focused test design using Arrange-Act-Assert and descriptive test names.
  • Framework guidance for Jest, Vitest, and pytest, including mocks, spies, fixtures, and parameterization.
  • Coverage gating, CI enforcement, snapshot testing, fake timers, and mutation testing for high-confidence suites.
  • Use case: tighten a flaky codebase by replacing over-mocked tests with deterministic, isolated tests that fail when business logic changes.

Quick Start

Ask me to write or improve unit tests for your project using the appropriate framework and testing patterns.

Frequently Asked Questions about unit-testing

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

FAQPage Schema
How do I write reliable unit tests that catch regressions without brittle implementation checks?

Behavior-focused unit tests use Arrange-Act-Assert structure and descriptive names to verify business logic. This approach catches regressions early by testing outcomes rather than brittle implementation paths, ensuring your suite remains stable during refactoring.

How do I set up framework-specific mocking and fake timers for Jest or Vitest?

Jest and Vitest configuration requires correct framework-specific setup for test doubles, mocks, and fake timers. You configure these tools to isolate external boundaries deterministically, ensuring your unit tests run consistently without relying on actual time or external state.

Does this unit testing approach support both Node and Python projects?

Yes, the unit testing workflows cover both Node and Python projects. Node projects use Jest or Vitest, while Python projects use pytest, providing framework-specific guidance for mocks, fixtures, and parameterization across both ecosystems.

How do I enforce coverage thresholds that fail the CI build when tests underperform?

Coverage gating enforces minimum coverage thresholds that fail the CI build when the suite underperforms. You configure these checks during CI verification to ensure new code meets coverage requirements before deployment, preventing insufficient test suites from passing.

What is mutation testing and when do I need it for my test suite?

Mutation testing evaluates test suite effectiveness by modifying application code to see if tests catch the changes. You need it when high coverage still misses edge cases, providing higher confidence that your unit tests actually validate business logic rather than just executing code paths.

Why do my unit tests fail randomly and how do I replace over-mocked tests with deterministic ones?

Flaky unit tests often result from over-mocking and lack of isolation from external boundaries. You replace them with deterministic, isolated tests using proper test doubles and fake timers, ensuring tests only fail when actual business logic changes.