mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-15 20:20:09 +00:00
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.
27 lines
835 B
JavaScript
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()));
|
|
}
|
|
});
|
|
});
|
|
}); |