mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-20 05:11:48 +00:00
test(auth): add comprehensive tests for GLM auth persistence fix
Add 26 new unit tests covering: - isFirstTimeInstall() legacy config detection (8 tests) - loadSettingsFromFile() path expansion (5 tests) - ProfileDetector detectProfileType() (4 tests) - expandPath() cross-platform handling (10 tests) Test coverage for issue #195: - Legacy config.json/profiles.json detection - Tilde expansion to home directory - Environment variable expansion (${VAR}, $VAR, %VAR%) - Mixed path separator normalization - Corrupted config graceful handling Files: - tests/unit/commands/setup-command.test.ts - tests/unit/auth/profile-detector.test.ts - tests/unit/utils/expand-path.test.ts
This commit is contained in:
1 parent
adb6222bc6
commit
92a79aa78b
7 files changed
+369
-5
No files matched your search
@@ -65,7 +65,7 @@ export interface ProfileNotFoundError extends Error {
|
||||
* Uses expandPath() for consistent cross-platform path handling.
|
||||
* Returns empty object on error.
|
||||
*/
|
||||
function loadSettingsFromFile(settingsPath: string): Record<string, string> {
|
||||
export function loadSettingsFromFile(settingsPath: string): Record<string, string> {
|
||||
const expandedPath = expandPath(settingsPath);
|
||||
try {
|
||||
if (!fs.existsSync(expandedPath)) return {};
|
||||
|
||||
Reference in new issue
Block a user