AgentSkillsCN

test

为注册表运行测试套件。在执行测试、检查单元测试、集成测试、性能测试、回归测试,或通过覆盖率验证代码变更时使用。

SKILL.md
--- frontmatter
name: test
description: Run test suites for the registry. Use when running tests, checking unit tests, integration tests, performance tests, regression tests, or validating code changes with coverage.

Test Suite Runner

Run test suites using Bun's native test runner.

Usage

text
/test                    - Run all tests
/test unit               - Run unit tests only
/test integration        - Run integration tests only
/test performance        - Run performance tests only
/test regression         - Run regression tests only
/test <pattern>          - Filter tests by name pattern
/test -t <pattern>       - Filter tests by name (explicit)
/test --coverage         - Run with coverage report
/test --watch            - Watch mode for development
/test --bail             - Stop on first failure
/test --bail=10          - Stop after 10 failures

Test Categories

CategoryPathDescription
unittest/unit/Core functionality and routing
integrationtest/integration/API and MCP server behavior
performancetest/performance/Benchmark validation
regressiontest/regression/Performance baselines

Examples

bash
# Run all tests
bun test

# Run unit tests with coverage
/test unit --coverage

# Watch mode during development
/test --watch

# Run specific test pattern
/test "routing"

# Stop on first failure
/test --bail

Additional Flags

text
/test --update          - Update snapshots (bun test -u)
/test --timeout 10000   - Custom timeout in milliseconds
/test --concurrent      - Run tests concurrently
/test --randomize       - Randomize test order

Common Commands

bash
# Update snapshots
bun test -u test/

# Run with specific timeout
bun test --timeout 10000 test/

# Run concurrent tests
bun test --concurrent test/

# Randomize test order
bun test --randomize test/

Performance Targets

MetricTargetDescription
Test executionSub-msPer individual test
CI pass rate99.9%Snapshot validation
Heap validation<50msMemory profiling

Related Skills

  • /bench - Performance benchmarks
  • /lint - Type checking
  • /dev - Development server