writing-good-tests

Guide writing and reviewing JS/TS unit, integration, and end-to-end tests.

5|1|Updated Jan 26, 2026
One-click install
npx skills add https://github.com/ed3dai/ed3d-plugins-testing --skill writing-good-tests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-good-tests
Source: https://github.com/ed3dai/ed3d-plugins-testing/tree/main/plugins/ed3d-house-style/skills/writing-good-tests
Command: npx skills add https://github.com/ed3dai/ed3d-plugins-testing --skill writing-good-tests

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing and maintaining reliable tests is hard; teams struggle with flaky tests, unclear intent, and brittle mocks.

Core Features & Use Cases

  • Philosophy guidance: aligns test structure with real behavior and long-term maintainability.
  • Condition-based waiting: promotes robust tests that wait for actual conditions rather than fixed timeouts.
  • Mocking strategy: prescribes appropriate mocking and wrapper patterns to isolate units.
  • Test isolation: encourages deterministic tests that don't depend on execution order or shared state.

Quick Start

Review your current test suite and apply the guidelines to improve clarity, stability, and confidence in changes.

Frequently Asked Questions about writing-good-tests

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

FAQPage Schema
How do I fix flaky tests caused by arbitrary timeouts in JS/TS projects?

Replace arbitrary timeouts with condition-based waiting to fix flaky tests. This approach enforces robust tests that wait for actual conditions rather than fixed time durations, improving stability across unit, integration, and end-to-end tests.

What is the best way to structure mocks for test isolation?

The best way to structure mocks for test isolation is using safe, maintainable wrapper patterns. This prescribes appropriate mocking approaches to isolate units, ensuring deterministic tests that do not depend on execution order or shared state.

How do I improve test quality and maintainability when reviewing my test suite?

You can improve test quality by applying philosophy guidance that aligns test structure with real behavior. Reviewing your current test suite against these best practices improves clarity, stability, and confidence in changes.

Does this test philosophy apply to both unit and end-to-end tests?

Yes, this test philosophy applies to unit, integration, and end-to-end tests across JS/TS projects. It embeds best practices into writing and reviewing tests, guiding structure, waiting strategies, and mocking approaches consistently.

Why does my test suite fail when tests run in a different execution order?

Your test suite fails because tests lack proper isolation and depend on shared state. Enforcing explicit test isolation ensures deterministic tests that do not depend on execution order, preventing unpredictable failures.