skill-testing-standards

Standardize Meridian service tests with table-driven cases and testify assertions.

10|2|Updated Oct 24, 2025
One-click install
npx skills add https://github.com/meridianhub/meridian --skill skill-testing-standards
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: skill-testing-standards
Source: https://github.com/meridianhub/meridian/tree/main/.claude/skills/testing
Command: npx skills add https://github.com/meridianhub/meridian --skill skill-testing-standards

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Helps teams implement consistent, defensive testing practices across Meridian services, reducing flaky tests and improving confidence in test results.

Core Features & Use Cases

  • Defensive testing patterns: test happy paths AND unhappy paths (ADR-0008) across unit and integration tests.
  • Table-driven tests: use rationale fields explaining WHY each case matters and ensure isolation.
  • Use Testcontainers for database tests to provide deterministic, repeatable environments.
  • Replace time.Sleep with await-based polling for asynchronous checks to improve reliability.
  • Structured assertions with testify: require for setup, assert for verifications, and clear error messaging.

Quick Start

Apply the recommended testing standards to new and existing services by replacing time.Sleep with await-based assertions and adopting table-driven testing.

Frequently Asked Questions about skill-testing-standards

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

FAQPage Schema
How do I reduce flaky integration tests caused by time.Sleep delays?

Replace time.Sleep with await-based polling for asynchronous checks to reduce flaky integration tests. Await-based assertions ensure conditions are met before proceeding, eliminating timing guesswork and false failures.

What is the best way to structure unit tests for both happy and unhappy paths?

Defensive testing patterns structure unit tests to cover both happy and unhappy paths, enforcing ADR-0008 requirements. Table-driven test cases with rationale fields explain why each scenario matters, ensuring comprehensive path coverage and isolation.

How do I set up deterministic database tests for repeatable environments?

Use Testcontainers to set up deterministic database tests that provide repeatable, isolated environments. Containerized databases ensure each test run starts from a clean state, preventing cross-test contamination and data-dependent flakiness.

Should I use testify require or assert for test setup and verification?

Use testify require for test setup operations that must halt on failure, and assert for verifications that should collect multiple errors. This structured assertion approach provides clear error messaging and prevents cascading test failures.

When should I apply table-driven tests over standard test functions?

Apply table-driven tests when validating multiple scenarios against the same logic, ensuring isolation and including rationale fields explaining why each case matters. This standardizes test cases and improves coverage visibility across defensive testing paths.