mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-15 02:16:27 +00:00
Problem: Test suite was directly modifying user's personal ~/.ccs/ directory, causing configuration interference during development. Solution: - Add test-environment.js fixture with CCS_HOME env var support - Update postinstall.js to respect CCS_HOME for test isolation - Update config-manager.ts with getCcsHome() helper - Update postinstall.test.js and cli.test.js to use isolated env - Remove auto-install of .claude/ symlinks from postinstall (users can run "ccs sync" to opt-in) Benefits: - Tests run in temp directories, no user config affected - Users control when .claude/ items are installed via "ccs sync" - All 39 tests passing with proper isolation
npm Package Tests
Tests for npm installation method of CCS.
Files
postinstall.test.js- Postinstall behavior and configuration creationcli.test.js- CLI argument parsing and profile handlingcross-platform.test.js- Cross-platform compatibility tests
Running
# Run only npm tests
npm run test:npm
# Run with verbose output
npm run test:npm -- --reporter spec
# Run specific test file
npx mocha tests/npm/postinstall.test.js
Test Coverage
These tests cover:
- Postinstall script behavior (Section 10 from original edge-cases.sh)
- CLI argument parsing for npm package
- Cross-platform path handling
- Configuration file creation and management
- Profile system functionality