Gateway Testing
The DeployStack Gateway includes testing infrastructure for ensuring reliability and quality of the CLI application.
Test Commands
Unit Tests
npm run test:unit
Currently displays a placeholder message as tests are not yet implemented.
Linting
npm run lint
Runs ESLint with automatic fixing of common issues. Essential for maintaining code quality.
Build Verification
npm run build
Compiles TypeScript to JavaScript and verifies the build process.
Development Workflow
Local Development
npm run dev
Starts the gateway in development mode with hot reload using ts-node-dev
.
Manual Testing
npm run link
Links the local gateway for testing CLI commands globally.
After linking, test commands directly:
deploystack version
deploystack status
deploystack --help
Release Testing
Pre-release Checks
npm run release
Runs linting checks before creating a release through release-it
.
CI/CD Testing
The GitHub Actions workflow automatically runs:
- Build verification
- Linting checks
- Unit tests (when implemented)
Testing Strategy
CLI-Specific Testing
- Command validation: Ensure all commands parse correctly
- Output formatting: Verify chalk styling and user messages
- Error handling: Test failure scenarios and exit codes
- Cross-platform: Validate behavior on Windows, macOS, and Linux
Integration Points
- Authentication flows: Test login/logout workflows
- Configuration management: Verify config file operations
- Process management: Test MCP server spawning and cleanup
- Proxy functionality: Validate HTTP proxy routing
Future Testing Implementation
The gateway will include comprehensive testing using:
- vitest for unit testing
- supertest for HTTP endpoint testing
- msw for API mocking
- Cross-platform testing in CI/CD
Development Tips
Quick Validation
# Check command structure
deploystack --help
# Verify version info
deploystack version
# Test error handling
deploystack invalid-command
Build and Test Cycle
npm run lint # Fix code style issues
npm run build # Verify compilation
npm run link # Test locally
This testing approach ensures the gateway maintains high quality while remaining focused on the essential CLI functionality.