Testing Strategy
Description
This project is small, runs in a terminal, and is mostly deterministic. The testing strategy focuses on fast, reliable checks that validate core behavior and provide a safe merge gate for PRs.
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
Repository README
This is the README for jarrodwatts/claude-hud, shared by 6 entries
in this directory. It describes the repository, not this entry specifically.
Testing Strategy
This project is small, runs in a terminal, and is mostly deterministic. The testing strategy focuses on fast, reliable checks that validate core behavior and provide a safe merge gate for PRs.
Goals
- Validate core logic (parsing, aggregation, formatting) deterministically.
- Catch regressions in the HUD output without relying on manual review.
- Keep test execution fast (<5s) to support frequent contributor runs.
Test Layers
- Unit tests (fast, deterministic)
- Pure helpers:
getContextPercent,getModelName, token/elapsed formatting. - Render helpers: string assembly and truncation behavior.
- Transcript parsing: tool/agent/todo aggregation and session start detection.
- Integration tests (CLI behavior)
- Run the CLI with a sample stdin JSON and a fixture transcript.
- Validate that the rendered output contains expected markers (model, percent, tool names).
- Keep assertions resilient to minor formatting changes (avoid strict full-line matching).
- Golden-output tests (near-term)
- For known fixtures, compare the full output snapshot to catch subtle UI regressions.
- Update snapshots only when intentional output changes are made.
What to Test First
- Transcript parsing (tool use/result mapping, todo extraction).
- Context percent calculation (including cache tokens).
- Truncation and aggregation (tools/todos/agents display logic).
- Malformed or partial input (bad JSON lines, missing fields).
Fixtures
- Keep shared test data under
tests/fixtures/. - Use small JSONL files that capture one behavior each (e.g., basic tool flow, agent lifecycle, todo updates).
Running Tests Locally
npm test
This runs `npm run build` and then executes Node's built-in test runner.
To generate coverage:
npm run test:coverage
To update snapshots:
npm run test:update-snapshots
CI Gate (recommended)
npm cinpm run buildnpm test
The provided GitHub Actions workflow runs `npm run test:coverage` on Node 18 and 20.
These steps should be required in PR checks to ensure new changes do not regress existing behavior.
Contributing Expectations
- Add or update tests for behavior changes.
- Prefer unit tests for new helpers and integration tests for user-visible output changes.
- Keep tests deterministic and avoid time-dependent assertions unless controlled.
Related Skills
Spec Kit
💫 Toolkit to help you get started with Spec-Driven Development
Testing Webapp Testing
Test local web applications using Playwright for UI verification and debugging
Testing #29
, [#52](https://github.com/affaan-m/everything-claude-code/issues/52), [#103](https://github.com/affaan-m/ever
Testing Fix Issue
by metabase - Addresses GitHub issues by taking issue number as parameter, analyzing context, implementing sol
Testing Pypict Test Design
Design comprehensive test cases using PICT (Pairwise Independent Combinatorial Testing) for optimized test sui
Testing gstack
| 15,000+ | Garry Tan's exact Claude Code setup: 6 opinionated tools that serve as CEO, Eng Manager, Release M
Testing