testing-strategy

Guidelines for writing effective tests in this project

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "testing-strategy" with this command: npx skills add block/agent-skills/block-agent-skills-testing-strategy

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

  1. Arrange-Act-Assert: Structure tests clearly
  2. One assertion per test: When possible, test one behavior
  3. Descriptive names: Test names should describe the scenario
  4. No test interdependence: Tests should run in any order
  5. 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

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

Sharedintellect Quorum

Multi-agent validation framework — 6 independent AI critics evaluate artifacts against rubrics with evidence-grounded findings.

Registry SourceRecently Updated
3670Profile unavailable
Coding

GitHub Development Standard

完整的 GitHub 项目开发标准流程 - 用方法论驯服低端模型,9步流程 + 4层验证 + 15项验收清单

Registry SourceRecently Updated
710Profile unavailable
Coding

Test Driven Development

Test-driven development with red-green-refactor loop and de-sloppify pattern. Use when user wants to build features or fix bugs using TDD, mentions "red-gree...

Registry SourceRecently Updated
1290Profile unavailable
Coding

code-review

No summary provided by upstream source.

Repository SourceNeeds Review