testing-patterns

Applies testing principles and runs unit, integration, and coverage tests for Node.js and Python projects.

Updated Mar 17, 2026
One-click install
npx skills add https://github.com/beliciobcardoso/mcp-postgres --skill testing-patterns-beliciobcardoso
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: testing-patterns
Source: https://github.com/beliciobcardoso/mcp-postgres/tree/main/.agent/skills/testing-patterns
Command: npx skills add https://github.com/beliciobcardoso/mcp-postgres --skill testing-patterns-beliciobcardoso

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Writing and running consistent, well-structured tests is hard: teams struggle with choosing between unit, integration, and E2E tests, applying mocking correctly, and executing test suites across different frameworks like Jest, Vitest, and pytest. ## Core Features & Use Cases - Testing Principles Reference: Covers the testing pyramid, AAA pattern, mocking strategies, test data factories, and common anti-patterns. - Unified Test Runner: Detects the project type (Node.js or Python) and runs the appropriate test command with optional coverage reporting. - Structured Results: Parses test output to report total, passed, and failed test counts as JSON. - Use Case: Point the runner at a repository to automatically detect whether it uses Jest, Vitest, or pytest, execute the suite with coverage, and get a summarized pass/fail report. ## Quick Start Run the test suite with coverage for the project in the current directory and summarize the results.

Frequently Asked Questions about testing-patterns

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

FAQPage Schema
How do I run tests with coverage in a Node.js or Python project?▼

Run the test_runner.py script with the project path and the --coverage flag. It detects Jest, Vitest, or pytest automatically and executes the matching coverage command, then reports pass/fail counts.

What is the difference between unit, integration, and E2E tests?▼

Unit tests verify isolated functions and run fast, integration tests check APIs, databases, and services, and E2E tests validate critical user flows. The testing pyramid recommends many unit tests, some integration tests, and few E2E tests.

When should I mock dependencies in unit tests?▼

Mock external APIs, databases, network calls, time, and randomness to keep unit tests fast and isolated. Do not mock the code under test, pure functions, or simple in-memory dependencies.

Does the test runner support frameworks other than Jest and pytest?▼

It supports npm test scripts, Jest, and Vitest for Node.js projects, and pytest for Python projects. Projects without a detected framework report that no tests are configured and exit successfully.

Why are my tests flaky and how do I fix them?▼

Flaky tests usually come from shared state, order dependencies, or unmocked time and randomness. Fix the root cause by resetting state between tests, making tests independent, and mocking nondeterministic sources.