Use when adding new error messages to React, or seeing "unknown error code" warnings.
0
0
# Install this skill:
npx skills add block/Agent-Skills --skill "testing-strategy"
Install specific skill from multi-skill repository
# Description
Guidelines for writing effective tests in this project
# SKILL.md
name: testing-strategy
description: Guidelines for writing effective tests in this project
author: goose
version: "1.0"
tags:
- testing
- development
- quality
Testing Guidelines
Unit Tests
- Test one thing per test
- Use descriptive test names:
test_user_creation_fails_with_invalid_email - Mock external dependencies
- Keep tests fast and isolated
Integration Tests
- Test API endpoints with realistic data
- Verify database state changes
- Clean up test data after each test
- Use test fixtures for common scenarios
Running Tests
# Run all tests
npm test
# Run unit tests only
npm test:unit
# Run integration tests (requires database)
npm test:integration
# Run tests with coverage
npm test:coverage
Test Structure
tests/
βββ unit/ # Fast, isolated unit tests
βββ integration/ # Tests requiring external services
βββ fixtures/ # Shared test data
βββ helpers/ # Test utilities
Best Practices
- Arrange-Act-Assert: Structure tests clearly
- One assertion per test: When possible, test one behavior
- Descriptive names: Test names should describe the scenario
- No test interdependence: Tests should run in any order
- Clean state: Each test starts with a known state
Coverage Goals
- Aim for 80%+ line coverage
- Focus on critical paths first
- Don't sacrifice test quality for coverage numbers
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Amp
Antigravity
Claude Code
Clawdbot
Codex
Cursor
Droid
Gemini CLI
GitHub Copilot
Goose
Kilo Code
Kiro CLI
OpenCode
Roo Code
Trae
Windsurf
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.