claude-launcher-profiles/tests
dschlueter 44a9a02a94 test: add profile-logic and installer test suite
bash tests/test_profiles.sh  (or: make test)

Covers the bug classes that surfaced during recent work, without any
external dependencies or network:

Profile logic (stub `claude` captures exported ANTHROPIC_* env):
- pro profile clears stale ANTHROPIC env and launches claude
- glm/free profiles export BASE_URL/AUTH_TOKEN/MODEL correctly
- error paths: missing OPENROUTER_API_KEY, unknown profile, bad mode
  each exit 1

Installer symlink logic (isolated temp HOME, throwaway clone):
- S1 broken/dangling symlink -> repointed via ln -sfn (was fatal before)
- S2 real directory at target -> warning, preserved (was silent)
- S3 free path -> new symlink created
- S4 existing symlink -> repointed

All tests use temp dirs for HOME and a throwaway repo clone, so the real
working tree is never touched.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-28 04:03:53 +02:00
..
test_profiles.sh test: add profile-logic and installer test suite 2026-06-28 04:03:53 +02:00