Skip to content

Add test coverage for critical automation scripts #44

@PAMulligan

Description

@PAMulligan

Summary

Only 2 of 25+ scripts have automated tests (canva-pipeline.test.js, visual-diff.test.js). Critical pipeline infrastructure scripts have zero test coverage.

Scripts Needing Tests (Priority Order)

P0 — Pipeline Infrastructure

  • pipeline-cache.js — cache validity, invalidation, status reporting
  • stage-profiler.js — timing data, report generation, history tracking
  • metrics-dashboard.js — HTML generation, summary output, trend analysis
  • incremental-build.sh — phase detection, cache hits/misses, parallel execution
  • sync-tokens.sh — drift detection, lockfile comparison, auto-update

P1 — Quality Gate Scripts

  • verify-tokens.sh — hardcoded value detection, token violation reporting
  • verify-test-coverage.sh — component-to-test mapping validation
  • check-dead-code.sh — unused export detection, false positive handling
  • check-security.sh — vulnerability scanning, severity filtering

P2 — Generation Scripts

  • generate-stories.sh — Storybook story output validation
  • generate-component-docs.sh — MDX output validation
  • generate-api-client.sh — OpenAPI spec parsing, TypeScript output

P3 — Verification Scripts

  • check-responsive.sh — breakpoint screenshot capture
  • audit-cross-browser-css.sh — CSS compatibility detection
  • regression-test.sh — baseline comparison, threshold handling

Acceptance Criteria

  • Each script has at least one test file in scripts/__tests__/
  • Tests cover happy path and primary error cases
  • Tests can run without external dependencies (MCP servers, browsers) where possible
  • CI can run the test suite

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestgood first issueGood for newcomersjavascriptPull requests that update javascript code

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions