Files
ccs/tests/npm
kaitranntt b34469d75f refactor(config): migrate to config.yaml as primary format
- Update postinstall.js to create config.yaml instead of config.json
- Update recovery-manager to create config.yaml as primary config
- Fix isFirstTimeInstall() to check for meaningful config content
  (profiles, accounts, variants, oauth_accounts, remote proxy)
- Update validation to accept config.yaml OR config.json
- Preserve backward compatibility: legacy config.json is migrated
  to config.yaml on first run via autoMigrate()
- Update postinstall tests to verify config.yaml creation

Fixes #142 - remote CLIProxyAPI configuration
2025-12-23 21:54:55 -05:00
..

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

# 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