rule-testing

Enforce fixture-driven Vitest schema tests with 100% coverage in TypeScript projects.

1|Updated Apr 17, 2025
One-click install
npx skills add https://github.com/carrot-foundation/schemas --skill rule-testing-carrot-foundation
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rule-testing
Source: https://github.com/carrot-foundation/schemas/tree/main/.agents/skills/rule-testing
Command: npx skills add https://github.com/carrot-foundation/schemas --skill rule-testing-carrot-foundation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Ensures rigorous, repeatable testing practices for schema validation by enforcing 100% test-coverage and fixture-driven data, reducing bugs in published libraries.

Core Features & Use Cases

  • Fixtures-driven data patterns for reliable and maintainable tests
  • Enforced conventions for test file placement using .spec.ts adjacent to source
  • 100% coverage thresholds with guidance for end-to-end test completeness across schemas
  • Use cases include validating MassID-like schemas, ensuring test suites remain in sync with data models

Quick Start

Run the test suite with Vitest using the provided fixtures to ensure 100% coverage across all schemas.

Frequently Asked Questions about rule-testing

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

FAQPage Schema
How do I enforce 100% test coverage for schema validation in TypeScript?▼

To enforce 100% test coverage for schema validation in TypeScript, use Vitest with fixture-driven data patterns and strict coverage thresholds applied to .spec.ts files.

What is fixture-driven testing and how does it improve schema test reproducibility?▼

Fixture-driven testing uses centralized, reusable sample data to validate schemas, ensuring deterministic test execution and keeping test suites reliably in sync with data models.

How do I organize Vitest test files for deterministic schema testing?▼

Organize Vitest test files by placing .spec.ts files directly adjacent to source files, utilizing centralized fixtures to maintain explicit test organization and reproducible execution.

Can I use Vitest to validate complex schemas with reusable test data?▼

Yes, you can use Vitest to validate schemas by applying fixture-driven patterns, which allow centralized data reuse and ensure rigorous coverage across all schema test cases.

Why does my TypeScript schema test suite fail to maintain complete test coverage?▼

Schema test suites fail coverage when test data is not synchronized with data models; enforcing fixture-driven Vitest patterns with 100% coverage thresholds resolves this gap.