[jsweep] Clean check_runs_helpers: add comprehensive test coverage#27973
[jsweep] Clean check_runs_helpers: add comprehensive test coverage#27973
Conversation
Add 17 tests covering isDeploymentCheck, selectLatestRelevantChecks, and getFailingChecks functions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a new Vitest test suite to provide coverage for the pure Node.js utility module check_runs_helpers.cjs.
Changes:
- Added
actions/setup/js/check_runs_helpers.test.cjscoveringisDeploymentCheck,selectLatestRelevantChecks, andgetFailingChecks. - Validated key behaviors including deployment filtering, latest-per-name selection, include/exclude lists, excluded IDs, and pending/failing semantics.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/check_runs_helpers.test.cjs | Introduces comprehensive unit tests for all exported helpers in check_runs_helpers.cjs. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 0
🧪 Test Quality Sentinel ReportTest Quality Score: 89/100✅ Excellent test quality
Test Classification DetailsView all 17 test classifications
Flagged Tests — Requires ReviewNo tests were flagged. All 17 tests verify observable behavioral contracts. Scoring Breakdown
Language SupportTests analyzed:
No Go tests were added or modified in this PR. Verdict
📖 Understanding Test ClassificationsDesign Tests (High Value) verify what the system does:
Implementation Tests (Low Value) verify how the system does it:
Goal: Shift toward tests that describe the system's behavioral contract — the promises it makes to its users and collaborators. References: §24818328990
|
Summary
Added comprehensive test coverage for
check_runs_helpers.cjs, which previously had no test file.File:
check_runs_helpers.cjsContext: Pure Node.js utility module (no github-script context)
What was improved:
check_runs_helpers.test.cjswith 17 tests covering all exported functionsTest Coverage Added
isDeploymentCheckselectLatestRelevantChecksgetFailingChecksValidation Checks
npm run format:cjs— passednpm run lint:cjs— passednpm run typecheck— passednpx vitest run check_runs_helpers.test.cjs— 17/17 passed