-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
The run command has unit tests for utility functions (parsePackageSpec, getCacheDir, resolveArgs), but lacks integration tests for the main handleRun function and error handling paths.
Current Test Coverage
parsePackageSpec- parsing@scope/name@versionspecsgetCacheDir- cache directory path generationresolveArgs-${__dirname}placeholder resolution
Proposed Tests
| Test | Value | Effort | Notes |
|---|---|---|---|
Integration: handleRun with mock bundle |
High | Medium | Mock registry client, verify spawn args |
--update flag forces re-download |
Medium | Medium | Verify cache is invalidated |
| PYTHONPATH env var set correctly | Medium | Low | Verify deps/ is prepended |
| Error handling: missing manifest | Medium | Medium | Should throw clear error |
| Error handling: network errors | Medium | Medium | Graceful failure with message |
Implementation Notes
- Consider using
vitestmocking forRegistryClientandspawn - Could create a test fixture
.mcpbbundle for integration tests - Python PYTHONPATH test could verify env object without spawning
Files
src/commands/packages/run.ts- implementationsrc/commands/packages/run.test.ts- existing unit tests
Metadata
Metadata
Assignees
Labels
No labels