testing

Enforces standardized unit testing rules for TypeScript projects using Vitest and Jest.

1|Updated Dec 21, 2025
One-click install
npx skills add https://github.com/DIO0550/d-market --skill testing-dio0550
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/DIO0550/d-market/tree/main/plugins/typescript-rules-plugin/skills/testing
Command: npx skills add https://github.com/DIO0550/d-market --skill testing-dio0550

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Establishes a consistent set of unit testing rules for TypeScript projects to improve test reliability and maintainability, reducing brittle tests and variability across teams.

Core Features & Use Cases

  • Flat test structure guidance to avoid excessive describe nesting.
  • Clear mocking rules to minimize fake dependencies and encourage real behavior where possible.
  • Support for parameterized tests using test.each-like patterns to cover input combinations.
  • Real-world scenario: refactor a test suite to a flat structure with minimal mocks and add parameterized cases for edge inputs.

Quick Start

Follow the guidelines to refactor an existing test module to a flat structure, replace unnecessary mocks, and add 2-3 parameterized tests.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I standardize TypeScript unit tests across my team?

To standardize TypeScript unit tests, enforce flat describe structures, strict mocking policies, and parameterized tests using test.each patterns. This approach minimizes brittle tests and ensures consistent quality across Vitest and Jest codebases.

What is a flat test structure in Vitest and Jest?

A flat test structure in Vitest and Jest avoids excessive describe nesting by organizing tests at a minimal hierarchy level. This guideline improves readability and maintainability by preventing deeply nested blocks that obscure test logic.

How do I write parameterized tests in TypeScript?

Write parameterized tests in TypeScript using test.each-like patterns to cover multiple input combinations. This data-driven approach runs identical test logic against varied datasets, ensuring comprehensive coverage for edge case inputs.

Does this testing approach work with both Jest and Vitest?

Yes, these testing guidelines work with both Vitest and Jest. The rules enforce flat describe blocks, mocking discipline, and parameterized tests specifically tailored for TypeScript projects running on either testing framework.

What are the best mocking rules for TypeScript unit tests?

The best mocking rules for TypeScript unit tests minimize fake dependencies and encourage real behavior where possible. Clear mocking policies reduce brittle tests by limiting unnecessary mocks, ensuring tests validate actual application behavior rather than mock configurations.

How do I refactor a test suite to use minimal mocks?

Refactor a test suite to use minimal mocks by replacing unnecessary fake dependencies with real implementations, flattening describe blocks, and adding 2-3 parameterized tests for edge inputs using test.each patterns to verify data-driven scenarios.