test(scripts): add test coverage for critical automation scripts#54
Merged
PAMulligan merged 5 commits intomainfrom Apr 2, 2026
Merged
Conversation
Cover all CLI commands (hash, check, update, invalidate, clean, status, hit, miss) with 40 tests verifying JSON output, exit codes, manifest persistence, cache roundtrips, and error handling via subprocess execution. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 tasks
44 subprocess-based tests covering summary, trends, compare, and generate commands with controlled fixture data, error cases, and edge cases. Documents a parseArgs quirk where the second positional arg in compare is lost due to eager target assignment before the loop. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix ESLint errors: replace require() with ESM import in verify-tokens test, remove unused imports (afterEach, existsSync, unlinkSync, extname, basename, execSync, readdirSync, statSync, METRICS_FILE, REPORT_DIR) - Fix Prettier formatting on 8 files (6 test files + 2 source scripts) - Fix CI workflow: use --config scripts/__tests__/vitest.config.js to enforce fileParallelism:false, preventing shared state corruption between pipeline-cache, stage-profiler, and metrics-dashboard tests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The script's find command excludes */__tests__/* paths, which silently hid all fixture files when they lived under scripts/__tests__/fixtures/. Moving fixtures to os.tmpdir() avoids the exclusion pattern. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vitest.config.jsfor sequential execution of tests that share state filesTest Coverage by Priority
P0 — Pipeline Infrastructure (5 scripts)
pipeline-cache.js— hash, check, update, invalidate, status, clean, hit/miss commandsstage-profiler.js— start/end timing, complete, report, history, analyzemetrics-dashboard.js— summary, trends, compare, generate (HTML/MD/JSON)incremental-build.sh— help, phase validation, configuration displaysync-tokens.sh— drift detection, JSON output, missing lockfile handlingP1 — Quality Gate Scripts (4 scripts)
verify-tokens.sh— hex colors, arbitrary Tailwind values, inline styles, CSS colors, token-ok exceptionsverify-test-coverage.sh— component-test mapping, imports, orphan tests, RTL queries, empty testscheck-dead-code.sh— config toggle, JSON output, help/flag parsingcheck-security.sh— audit output, --no-fail, JSON output, --level flagP2 — Generation Scripts (3 scripts)
generate-stories.sh— story generation, dry-run, force, skip logic, summary countsgenerate-component-docs.sh— MDX output, index generation, custom output dirgenerate-api-client.sh— spec detection, missing spec, flag parsingP3 — Verification Scripts (3 scripts)
check-responsive.sh— help flag, breakpoint configaudit-cross-browser-css.sh— webkit prefixes, backdrop-filter, :focus-visibleregression-test.sh— help flag parsingTest plan
npx vitest run --config scripts/__tests__/vitest.config.js scripts/__tests__/)🤖 Generated with Claude Code