mcpField
T
testing-unit

testing-unit

github.com/wojonsTesting & quality343 installsUpdated 30w ago
Repository

About testing-unit

A unit-testing skill for isolating functions, methods, and classes from their dependencies. It supports test creation, execution, coverage measurement, and CI/CD integration.

Key features

  1. 01Identify testable units
  2. 02Create fixtures and mock dependencies
  3. 03Cover normal, edge, and error cases
  4. 04Run tests and report results
  5. 05Measure code coverage
  6. 06Integrate tests with CI/CD

Use cases

  1. 01Test new code before integration
  2. 02Check for regressions during refactoring
  3. 03Run automated tests in CI/CD

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/wojons/skills --skill testing-unit

After installing, type/testing-unitin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

README.md
references/
README.md
scripts/
example.sh

Details

From the project README

Unit Testing

Test individual functions, methods, and classes in isolation from dependencies.

When to use me

Use this skill when:

  • Writing new code to ensure it works correctly
  • Refactoring existing code without breaking functionality
  • During continuous integration to catch regressions early
  • Following Test-Driven Development (TDD) practices

What I do

  • Identify testable units (functions, methods, classes)
  • Set up test fixtures and mock dependencies
  • Write test cases covering normal, edge, and error conditions
  • Run unit tests and report pass/fail status
  • Measure code coverage for tested units
  • Integrate with CI/CD pipelines for automated testing

Examples

# Run unit tests with common frameworks
npm test                    # Node.js with Jest/Mocha
python -m pytest tests/     # Python with pytest
go test ./...              # Go built-in testing
cargo test                 # Rust with Cargo
dotnet test               # .NET with xUnit/NUnit

# Run specific test files
npm test -- src/utils.test.js
pytest tests/test_auth.py

# Run with coverage reporting
npm test -- --coverage
pytest --cov=src tests/

Output format

✓ Test Suite: UserService
  ✓ should create user with valid data
  ✓ should reject duplicate email
  ✗ should handle database connection errors (failed)
    Expected: "Connection error handled"
    Received: "Unhandled database error"

Coverage: 92% (15/16 lines)
Failed: 1 test

Notes

  • Unit tests should be fast (milliseconds per test)
  • Mock external dependencies (databases, APIs, filesystem)
  • Aim for high code coverage (80-90%+)
  • Tests should be independent and order-agnostic
  • Follow AAA pattern: Arrange, Act, Assert
  • Use test doubles (mocks, stubs, spies) appropriately

Comments

Markdown supported