Commit f08316b
committed
test(fix): cover coana-fix to 100%
Add a new coana-fix.test.mts that drives the previously-uncovered
branches in coana-fix.mts:
- local-mode info messages (partial CI vars, outputFile copy, spawnCoanaDlx error, prLimit=0)
- CI-mode discovery edge cases (catch on getSocketFixPrs counting throw, non-array JSON, parse error, empty output, spawn throw, discovery ok:false)
- explicit-ghsas slice path in CI mode
- per-GHSA PR flow: skipped-count log, cleanup PR debug + catch
- per-id fix failure / no modified files / unstaged ok:false continues
- superseded-PR closing including inner catch on octokit failure
- existing-open-PR skip-continue
- stale-branch cleanup-continue
- missing GitHub token continue
- push-failure cleanup including gitRemoteBranchExists throwing
- PR autopilot success + auto-merge failure (with and without details)
- PR creation failure reasons: already_exists / validation_error / permission_denied / network_error / unknown
- unexpected-exception cleanup + cleanupErrorBranches throwing
The one remaining unreachable branch (the `if (!fixEnv.repoInfo)` guard
after line 168 already proves repoInfo truthy) is wrapped in a c8
ignore start/stop block.1 parent 4ab66aa commit f08316b
4 files changed
Lines changed: 1642 additions & 68 deletions
File tree
- packages/cli
- src
- commands/fix
- utils/dlx
- test/unit
- commands/fix
- utils/dlx
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
| 358 | + | |
358 | 359 | | |
359 | 360 | | |
360 | 361 | | |
| 362 | + | |
361 | 363 | | |
362 | 364 | | |
363 | 365 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
| 436 | + | |
436 | 437 | | |
437 | 438 | | |
438 | 439 | | |
439 | 440 | | |
440 | 441 | | |
441 | 442 | | |
| 443 | + | |
442 | 444 | | |
443 | 445 | | |
444 | 446 | | |
| |||
0 commit comments