test-master

Document and apply standardized unit testing guidelines with factories, time mocks, and parameterized tests.

1|Updated May 18, 2025
One-click install
npx skills add https://github.com/practical-stack/astro-blog-kit --skill test-master-practical-stack
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-master
Source: https://github.com/practical-stack/astro-blog-kit/tree/main/.claude/skills/test-master
Command: npx skills add https://github.com/practical-stack/astro-blog-kit --skill test-master-practical-stack

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Unit test writing guidelines and patterns help teams produce consistent, reliable, and maintainable tests, reducing flaky results and speeding up development.

Core Features & Use Cases

  • Structured test scaffolding: Enforces Given-When-Then style for clarity.
  • Factory-based test data: Promotes reusable mock data via factories.
  • Time/mocking patterns: Provides patterns for deterministic time-based tests.
  • Parameterized testing: Data-driven tests reduce duplication and improve coverage.

Quick Start

Begin by reading these guidelines and write a new unit test using the Given-When-Then structure, data factories, and time-mocking patterns to validate core logic.

Frequently Asked Questions about test-master

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

FAQPage Schema
What are unit testing guidelines for writing maintainable tests?

Unit testing guidelines enforce clean conventions, separation of concerns, and clear naming to ensure testable, maintainable code. Structuring tests with Given-When-Then style improves clarity and reduces flaky results.

How do I create mock data for unit tests using factory patterns?

You create mock data by using factory patterns to build reusable test data. This promotes consistent data generation across tests, reducing duplication and ensuring reliable, maintainable test scaffolding.

How do I handle time mocking for deterministic unit tests?

Time mocking provides patterns for deterministic time-based tests by controlling temporal inputs. This prevents flaky results caused by real-time dependencies and ensures consistent test execution.

What is parameterized testing and when should I use it?

Parameterized testing is a data-driven approach that reduces duplication and improves coverage by running the same test logic against multiple inputs. Use it when validating core logic across varied scenarios.

What is the best way to structure unit test files for separation of concerns?

The best way to structure unit test files is by enforcing Given-When-Then scaffolding and clear naming conventions. This separates concerns, improves maintainability, and ensures reliable test execution.

Why does unit testing produce flaky results and how can I prevent it?

Unit testing produces flaky results when tests lack determinism due to uncontrolled time or inconsistent mock data. Prevent flakiness by applying factory patterns, time mocking, and standardized testing guidelines.