mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-12 22:40:24 +00:00
* test: remove 5 duplicate and theatrical test files Remove test files that are fully duplicated by more comprehensive counterparts, plus one theatrical test that only grep-checks shell script text without testing behavior. Duplicates removed: - manifest-validation.test.ts (subset of manifest-cache-lifecycle.test.ts) - matrix-compact-footer.test.ts (subset of commands-exported-utils.test.ts) - commands-output.test.ts (subset of commands-display.test.ts) - cloud-info.test.ts (subset of commands-cloud-info.test.ts) Theatrical test removed: - install-script-validation.test.ts (reads install.sh as string, checks substring presence -- tests that functions "exist" not that they work) All 1657 remaining tests pass. Zero regressions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * test: Fix always-pass pattern and stale comments - integration.test.ts: remove conditional `if (cacheExists)` block that silently skipped the cache-file assertion when the file wasn't written; the second loadManifest() call already exercises in-memory caching without needing the conditional; remove now-unused readFileSync/existsSync imports - commands.test.ts: remove stale references to cloud-info.test.ts and commands-output.test.ts (deleted in prior commit) from inline comment; remove unused createMockManifest import Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: spawn-qa-bot <qa@openrouter.ai> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| aws.test.ts | ||
| check-entity-messages.test.ts | ||
| check-entity.test.ts | ||
| clear-history.test.ts | ||
| cloud-credentials.test.ts | ||
| cmd-interactive.test.ts | ||
| cmd-listing-output.test.ts | ||
| cmdlast.test.ts | ||
| cmdlist-integration.test.ts | ||
| cmdrun-duplicate-detection.test.ts | ||
| cmdrun-happy-path.test.ts | ||
| commands-cloud-info.test.ts | ||
| commands-display.test.ts | ||
| commands-error-paths.test.ts | ||
| commands-exported-utils.test.ts | ||
| commands-name-suggestions.test.ts | ||
| commands-resolve-run.test.ts | ||
| commands-swap-resolve.test.ts | ||
| commands-update-download.test.ts | ||
| commands.test.ts | ||
| credential-hints.test.ts | ||
| custom-flag.test.ts | ||
| do-oauth.test.ts | ||
| download-and-failure.test.ts | ||
| fly.test.ts | ||
| fuzzy-key-matching.test.ts | ||
| history-trimming.test.ts | ||
| history.test.ts | ||
| integration.test.ts | ||
| manifest-cache-lifecycle.test.ts | ||
| manifest-helpers.test.ts | ||
| manifest-integrity.test.ts | ||
| manifest-type-contracts.test.ts | ||
| manifest.test.ts | ||
| parse.test.ts | ||
| preflight-credentials.test.ts | ||
| preload.ts | ||
| prompt-file-security.test.ts | ||
| README.md | ||
| run-path-credential-display.test.ts | ||
| script-failure-guidance.test.ts | ||
| security-connection-validation.test.ts | ||
| security-edge-cases.test.ts | ||
| security-encoding.test.ts | ||
| security.test.ts | ||
| ssh-keys.test.ts | ||
| test-helpers.ts | ||
| unknown-flags.test.ts | ||
| update-check.test.ts | ||
| with-retry-result.test.ts | ||
CLI Tests
This directory contains comprehensive tests for the Spawn CLI TypeScript implementation.
Test Files
manifest.test.ts
Tests for manifest loading, caching, and parsing:
- Network fetching and fallback behavior
- Disk cache TTL and invalidation
- Offline mode with stale cache
- Agent/cloud key extraction
- Matrix status checking
- Implemented combination counting
commands.test.ts
Tests for CLI command handlers:
cmdHelp- Help text displaycmdList- Matrix table renderingcmdAgents- Agent listingcmdClouds- Cloud provider listingcmdAgentInfo- Agent details with available cloudscmdRun- Script execution with validation and fallback
integration.test.ts
Integration tests for end-to-end workflows:
- Version command
- Manifest caching across loads
- Offline scenarios
- Agent/cloud key extraction
- Matrix validation
- Implementation counting
Running Tests
# Run all tests once
npm test
# Run tests in watch mode
npm run test:watch
# Run with coverage (requires coverage provider)
npm test -- --coverage
Test Coverage
Current coverage targets critical paths:
- manifest.ts: ~80% coverage of caching, fetching, and parsing logic
- commands.ts: ~70% coverage of command handlers and validation
- integration: Basic end-to-end scenarios
Notes
- Tests use vitest for fast execution with Bun/Node compatibility
- Mock manifest data is used to avoid network dependencies
- Cache directory is isolated per test to prevent interference
- Some tests account for local
manifest.jsonfallback in project directory