Files
Charon/.github/skills/test-frontend-unit.SKILL.md
2026-01-26 19:22:05 +00:00

4.5 KiB

name, version, description, author, license, tags, compatibility, requirements, environment_variables, parameters, outputs, metadata
name version description author license tags compatibility requirements environment_variables parameters outputs metadata
test-frontend-unit 1.0.0 Run frontend unit tests without coverage analysis (fast execution) Charon Project MIT
testing
unit-tests
frontend
vitest
fast
os shells
linux
darwin
bash
name version optional
node >=18.0 false
name version optional
npm >=9.0 false
name type description default required
watch boolean Run tests in watch mode false false
name type description default required
filter string Filter tests by name pattern false
name type description
test_results stdout Vitest output showing pass/fail status
category subcategory execution_time risk_level ci_cd_safe requires_network idempotent
test unit short low true false true

Test Frontend Unit

Overview

Executes the frontend unit test suite using Vitest without coverage analysis. This skill provides fast test execution for quick feedback during development, making it ideal for pre-commit checks and rapid iteration.

Unlike test-frontend-coverage, this skill does not generate coverage reports or enforce coverage thresholds, focusing purely on test pass/fail status.

Prerequisites

  • Node.js 18.0 or higher installed and in PATH
  • npm 9.0 or higher installed and in PATH
  • Frontend dependencies installed (cd frontend && npm install)

Usage

Basic Usage

Run all frontend unit tests:

cd /path/to/charon
.github/skills/scripts/skill-runner.sh test-frontend-unit

Watch Mode

Run tests in watch mode for continuous testing:

.github/skills/scripts/skill-runner.sh test-frontend-unit -- --watch

Filter Tests

Run tests matching a specific pattern:

.github/skills/scripts/skill-runner.sh test-frontend-unit -- --grep "Button"

CI/CD Integration

For use in GitHub Actions or other CI/CD pipelines:

- name: Run Frontend Unit Tests
  run: .github/skills/scripts/skill-runner.sh test-frontend-unit

Parameters

Parameter Type Required Default Description
watch boolean No false Run tests in watch mode
filter string No "" Filter tests by name pattern

Environment Variables

No environment variables are required for this skill.

Outputs

Success Exit Code

  • 0: All tests passed

Error Exit Codes

  • Non-zero: One or more tests failed

Console Output

Example output:

✓ src/components/Button.test.tsx (3)
✓ src/utils/helpers.test.ts (5)
✓ src/hooks/useAuth.test.ts (4)

Test Files  3 passed (3)
     Tests  12 passed (12)

Examples

Example 1: Basic Execution

.github/skills/scripts/skill-runner.sh test-frontend-unit

Example 2: Watch Mode for TDD

.github/skills/scripts/skill-runner.sh test-frontend-unit -- --watch

Example 3: Test Specific File

.github/skills/scripts/skill-runner.sh test-frontend-unit -- Button.test.tsx

Example 4: UI Mode (Interactive)

.github/skills/scripts/skill-runner.sh test-frontend-unit -- --ui

Example 5: Reporter Configuration

.github/skills/scripts/skill-runner.sh test-frontend-unit -- --reporter=verbose

Error Handling

Common Errors

Error: Cannot find module

Solution: Run npm install to ensure all dependencies are installed

Error: Test timeout

Solution: Increase timeout in vitest.config.ts or fix hanging async tests

Error: Unexpected token

Solution: Check for syntax errors in test files

  • test-frontend-coverage - Run tests with coverage analysis (slower)
  • test-backend-unit - Backend Go unit tests
  • build-check-go - Verify builds without running tests

Notes

  • Execution Time: Fast execution (~3-5 seconds typical)
  • No Coverage: Does not generate coverage reports
  • Vitest Features: Full access to Vitest CLI options via arguments
  • Idempotency: Safe to run multiple times
  • Caching: Benefits from Vitest's smart caching
  • Suitable For: Pre-commit hooks, quick feedback, TDD workflows
  • Watch Mode: Available for interactive development

Last Updated: 2025-12-20 Maintained by: Charon Project Team Source: Inline task command