Overview
cc-statusline uses a combination of manual testing, preview functionality, and specialized test scripts to ensure generated statuslines work correctly.Quick Start
Build and Test
Development Workflow
1. Build the Project
- Production Build
- Watch Mode
dist/ directory.2. Test CLI Commands
Test Init Command
Test Preview Command
3. Test Generated Scripts
Direct Script Testing
With Mock JSON Data
Preview Functionality
The preview command provides comprehensive testing before installation.What Preview Does
Preview Output
Specialized Test Scripts
Installation Tests
- File creation
- Permission setting
- Settings.json updates
- Configuration validation
Locking Mechanism Tests
The ccusage integration includes file-based locking to prevent concurrent process spawning.- Single Test
- Concurrent Test
- Manual Stress Test
Expected Locking Behavior
Single Process Execution
Single Process Execution
Only 1 process runs ccusage at a time, preventing resource pile-up
Graceful Skipping
Graceful Skipping
Other processes skip ccusage gracefully without blocking or errors
Lock Cleanup
Lock Cleanup
Lock files are properly cleaned up after execution
No Hanging Processes
No Hanging Processes
All processes complete without hanging or orphaned children
Verification Commands
Manual Testing Checklist
Feature Testing
- Directory Display
- Git Integration
- Context Tracking
- Color Support
Error Conditions
Test graceful degradation:Performance Testing
Execution Time
Resource Usage
Integration Testing
Test in Real Claude Code
Settings Validation
Debugging
Enable Logging
Generate statusline with logging enabled:Common Issues
Statusline not showing
Statusline not showing
Features not working
Features not working
Performance issues
Performance issues
Test Coverage Areas
When adding new features, test:- ✅ With jq: Full functionality
- ✅ Without jq: Graceful fallback
- ✅ With colors: Proper ANSI codes
- ✅ Without colors: Clean output
- ✅ In git repo: Git features work
- ✅ Outside git: Git features skip gracefully
- ✅ With ccusage: Usage tracking works
- ✅ Without ccusage: Usage features skip
- ✅ Invalid JSON: No crashes
- ✅ Empty input: Sensible defaults
Next Steps
Contributing
Ready to contribute? Read the guide
Architecture
Understand the codebase structure