Files
ccs/tests/shared/unit/helpers.test.js
T
kaitranntt 1c3c4aade0 chore: complete TypeScript migration (Phase 05-06)
Phase 05: Migrate test imports from bin/ to dist/
- Update 19 test files to import from dist/ instead of bin/
- Update CLI path in cli.test.js and special-commands.test.js
- Update cross-platform.test.js to check dist/ directory

Phase 06: Cleanup & validation
- Remove bin/ directory (32 JS files)
- Fix ClaudeSymlinkManager import in doctor.ts
- Update postinstall.js to use dist/ modules
- Regenerate package-lock.json (now points to dist/ccs.js)

All 39 tests passing. TypeScript migration complete.
2025-11-26 20:20:54 -05:00

27 lines
835 B
JavaScript

const assert = require('assert');
const path = require('path');
const os = require('os');
const { expandPath } = require('../../../dist/utils/helpers');
describe('helpers', () => {
describe('expandPath', () => {
it('expands tilde to home directory', () => {
const expanded = expandPath('~/test');
assert.strictEqual(expanded, path.join(os.homedir(), 'test'));
});
it('expands environment variables', () => {
process.env.TEST_VAR = '/test/path';
const expanded = expandPath('${TEST_VAR}/file');
assert(expanded.includes('test'));
delete process.env.TEST_VAR;
});
it('handles Windows paths', () => {
if (process.platform === 'win32') {
const expanded = expandPath('%USERPROFILE%\\test');
assert(expanded.includes(os.homedir()));
}
});
});
});