diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 00000000..14911882 --- /dev/null +++ b/tests/README.md @@ -0,0 +1,41 @@ +# CCS Test Suite + +## Organization + +- `native/` - Traditional installation (curl|bash, irm|iex) + - `unix/` - Unix/Linux/macOS native tests + - `windows/` - Windows PowerShell tests +- `npm/` - npm package tests + - `postinstall.test.js` - Postinstall behavior tests + - `cli.test.js` - CLI argument parsing tests + - `cross-platform.test.js` - Cross-platform compatibility tests +- `unit/` - Node.js unit tests +- `integration/` - Integration tests +- `shared/` - Shared utilities and test data + +## Running Tests + +- All tests: `npm test` +- npm package tests only: `npm run test:npm` +- Native installation tests only: `npm run test:native` +- Unit tests only: `npm run test:unit` +- Integration tests only: `npm run test:integration` +- Master test suite (backward compatible): `npm run test:edge-cases` + +## Test Structure + +### Native Tests +Test the traditional installation methods where CCS is installed via: +- Unix/Linux/macOS: `curl | bash` +- Windows: `irm | iex` (PowerShell) + +These tests use bash/PowerShell scripts and test the `lib/ccs` and `lib/ccs.ps1` files. + +### npm Tests +Test the npm package installation where CCS is installed via: +- npm: `npm install -g @kaitranntt/ccs` + +These tests use Node.js/mocha framework and test the `bin/ccs.js` file. + +### Shared Utilities +Common test code, data, and helper functions are stored in `shared/` to avoid duplication across test suites. \ No newline at end of file diff --git a/tests/npm/README.md b/tests/npm/README.md new file mode 100644 index 00000000..3b738449 --- /dev/null +++ b/tests/npm/README.md @@ -0,0 +1,31 @@ +# npm Package Tests + +Tests for npm installation method of CCS. + +## Files + +- `postinstall.test.js` - Postinstall behavior and configuration creation +- `cli.test.js` - CLI argument parsing and profile handling +- `cross-platform.test.js` - Cross-platform compatibility tests + +## Running + +```bash +# 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 \ No newline at end of file