Skip to content

aiskillstore/marketplace / skills/0xdarkmatter/testing-patterns

testing-patterns

Verified

Cross-language testing strategies and patterns. Triggers on: test pyramid, unit test, integration test, e2e test, TDD, BDD, test coverage, mocking strategy, test doubles, test isolation.

scripts/coverage-check.sh

View on GitHub
#!/bin/bash
# Run tests with coverage and fail if below threshold
# Usage: ./coverage-check.sh [--threshold 80] [pytest-args...]

set -e

THRESHOLD=80
PYTEST_ARGS=""

# Parse arguments
while [[ $# -gt 0 ]]; do
    case $1 in
        --threshold)
            THRESHOLD="$2"
            shift 2
            ;;
        *)
            PYTEST_ARGS="$PYTEST_ARGS $1"
            shift
            ;;
    esac
done

echo "=== Running tests with coverage ==="
echo "Minimum coverage threshold: ${THRESHOLD}%"
echo ""

# Run pytest with coverage
pytest \
    --cov=src \
    --cov-report=term-missing \
    --cov-report=html \
    --cov-fail-under=${THRESHOLD} \
    ${PYTEST_ARGS}

echo ""
echo "=== Coverage report generated ==="
echo "HTML report: htmlcov/index.html"
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 197kUpdated Claude CodeCodexVerifiedInstall