testing

Guide JavaScript/TypeScript testing with TDD, test pyramid, and mocking strategies.

28|3|Updated Dec 10, 2025
One-click install
npx skills add https://github.com/ScientiaCapital/skills --skill testing-scientiacapital
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/ScientiaCapital/skills/tree/main/active/testing-skill
Command: npx skills add https://github.com/ScientiaCapital/skills --skill testing-scientiacapital

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

The Testing skill guides teams to adopt structured testing practices (TDD, test pyramid, and pragmatic mocking) to improve reliability, speed, and maintainability of software.

Core Features & Use Cases

  • TDD workflow guidance (Red-Green-Refactor): steps to write a failing test, implement minimal production code, and refactor without breaking tests.
  • Test Pyramid guidance and coverage targets: recommended distribution across unit, integration, and E2E tests with practical thresholds.
  • Mocking strategies and test organization: guidance on external dependencies, dependency injection, and colocated vs. integration tests.
  • Quality guards: guidance on testing edge cases, error paths, and deterministic tests to avoid flakiness.

Quick Start

Start by writing a failing unit test for a new function, then implement the simplest code to make it pass, and finally refactor while keeping the full test suite green.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I start practicing TDD in JavaScript projects?

TDD in JavaScript projects starts with writing a failing unit test, implementing the minimal production code to pass it, and refactoring while keeping the full test suite green.

What is the test pyramid and how does it guide unit and integration testing?

The test pyramid guides the distribution across unit, integration, and end-to-end tests, providing practical coverage thresholds to balance speed, reliability, and comprehensive functional testing.

What's the best way to mock external dependencies in integration testing?

Mocking external dependencies in integration testing is best handled through dependency injection and pragmatic mocking strategies, ensuring deterministic tests and avoiding flakiness on error paths.

Can I use framework-agnostic testing patterns for my TypeScript project?

Framework-agnostic testing patterns apply directly to TypeScript projects, offering actionable templates and organization guidance for structuring tests, setting coverage targets, and testing edge cases.

Why does my test suite have flaky tests and how do I fix them?

Flaky tests are fixed by applying quality guards that enforce deterministic tests, specifically by testing edge cases, error paths, and properly mocking external dependencies.