spawn/packages
A 72c3f23364
test: add comprehensive code coverage tests (#2802)
* test: add comprehensive coverage tests (67% → 85% lines)

Add 27 new test files with ~565 tests covering all major modules:

Shared modules:
- ui-cov: logging, prompts, validation, shellQuote, withRetry, loadApiToken
- ssh-cov: spawnInteractive, killWithTimeout, startSshTunnel, waitForSsh
- ssh-keys-cov: generateSshKey edge cases, key sorting, fingerprint
- oauth-cov: PKCE flow, code verifier/challenge, key management
- orchestrate-cov: provisioning flow, enabled steps, model preferences
- agent-setup-cov: wrapSshCall, createCloudAgents, GitHub auth

Commands:
- connect, status, uninstall, pick, delete, update, fix, interactive
- link, run, list (with formatRelativeTime, filters, actions)

Cloud providers:
- aws, gcp, digitalocean, hetzner, sprite (auth, CRUD, SSH ops)

Remaining:
- picker, unicode-detect, history, manifest, update-check

Also fixes:
- do-payment-warning.test.ts: use spyOn instead of mock.module for
  shared/ui to prevent cross-test contamination
- preflight-credentials.test.ts: resilient to @clack/prompts mock
  replacement by other test files

Coverage: 74% → 90% functions, 67% → 85% lines
Tests: 1467 → 2032, 0 failures

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test: expand coverage tests for commands, oauth, orchestrate, and link

Add 65+ new tests across 7 test files:
- cmd-list-cov: handleRecordAction branches (rerun, fix, no-connection),
  resolveListFilters with cloud filter, footer and empty message paths
- cmd-run-cov: showDryRunPreview edge cases, getScriptFailureGuidance
  for all exit codes, getSignalGuidance, cmdRun validation
- cmd-pick-cov: flag edge cases (missing values, multiple flags)
- cmd-link-cov: IP generation, detection spinner, invalid IP
- cmd-fix-cov: additional fix paths
- oauth-cov: non-standard key confirmation, null config handling
- orchestrate-cov: tunnel support, checkAccountReady, tarball,
  SPAWN_NAME, preLaunch, restart loop, step validation

Coverage: 90.50% functions, 85.13% lines (2097 tests, 0 failures)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test: add coverage thresholds (80% lines, 90% functions)

Configure bun test coverage thresholds in bunfig.toml to enforce
minimum coverage levels and prevent regressions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude <claude@anthropic.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 22:24:54 -07:00
..
cli test: add comprehensive code coverage tests (#2802) 2026-03-19 22:24:54 -07:00
shared feat: add downloadFile to CloudRunner + local OpenClaw config merge (#2636) 2026-03-14 15:47:32 -07:00