Skip to content

PMDevSolutions/Aurelius / .claude/skills/test

Test Runner

Run Vitest tests with coverage reporting.

Purpose

This command runs the project's test suite using Vitest and React Testing Library.

Usage

/test                                   # whole suite
/test src/components/Button.test.tsx    # one file
/test -t "should render" --coverage     # by name, with coverage

With arguments, run pnpm vitest run $ARGUMENTS; without, run the whole suite.

What this command does

  1. Detects test configuration (vitest.config.ts or vite.config.ts)
  2. Runs all tests with proper configuration
  3. Shows coverage report if configured
  4. Reports failures with clear error details

Steps

1. Run all tests

pnpm vitest run

2. Run with coverage

pnpm vitest run --coverage

3. Run specific test file

pnpm vitest run src/components/Button.test.tsx

4. Run in watch mode (interactive development)

pnpm vitest

5. Run tests matching a pattern

pnpm vitest run -t "should render"

Or use the project script

./scripts/run-tests.sh

Test Types

TypeToolPatternPurpose
UnitVitest*.test.tsPure functions, utilities
ComponentVitest + RTL*.test.tsxReact component behavior
HookVitest + RTL*.test.tsCustom hook logic
E2EPlaywright*.spec.tsFull user flows
VisualStorybook*.stories.tsxComponent states

Common Issues

  • Missing setup file: Create src/test/setup.ts with import '@testing-library/jest-dom'
  • JSX not recognized: Ensure environment: 'jsdom' in vitest config
  • Module resolution: Check resolve.alias matches tsconfig paths
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 318kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 318kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 318kUpdated 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: 196kUpdated Claude CodeCodexVerifiedInstall