mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-07 09:10:55 +00:00
- Set both TERM=linux and CI=true in unicode-detect.ts - CI env var provides additional Unicode disabling for @clack/prompts - Fix test imports to use package.json instead of deleted version.ts - Bump to 0.2.6 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| cli-pipeline.test.ts | ||
| commands-error-paths.test.ts | ||
| commands-helpers.test.ts | ||
| commands-logic.test.ts | ||
| commands-output.test.ts | ||
| commands-untested.test.ts | ||
| commands-update-download.test.ts | ||
| commands.test.ts | ||
| index-edge-cases.test.ts | ||
| index-parsing.test.ts | ||
| integration.test.ts | ||
| manifest-cache-lifecycle.test.ts | ||
| manifest-helpers.test.ts | ||
| manifest-validation.test.ts | ||
| manifest.test.ts | ||
| README.md | ||
| security-edge-cases.test.ts | ||
| security-encoding.test.ts | ||
| security.test.ts | ||
| test-helpers.ts | ||
| update-check.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