test: isolate shared-state test suites for CI stability

- add dependency injection to export-command, binary-manager,
  codex-plan-compatibility, config-command, and usage-syncer
- override process.exit in api-export test to prevent silent
  termination in Bun's parallel test runner
- harden test-environment bootstrap with process.env isolation
- fix auth middleware to avoid config upgrade during checks
This commit is contained in:
Tam Nhu Tran committed 2026-03-25 16:41:41 -04:00
1 parent 58891d368d
commit 3af554275e
24 files changed
+764 -614

No files matched your search

+2 -1
View File
@@ -16,6 +16,7 @@ import {
getDefaultProjectsDir,
type RawUsageEntry,
} from '../../src/web-server/jsonl-parser';
import { getDefaultClaudeConfigDir } from '../../src/utils/claude-config-path';
// ============================================================================
// TEST FIXTURES
@@ -545,6 +546,6 @@ describe('getDefaultProjectsDir', () => {
test('falls back to ~/.claude/projects', () => {
delete process.env.CLAUDE_CONFIG_DIR;
const dir = getDefaultProjectsDir();
expect(dir).toBe(path.join(os.homedir(), '.claude', 'projects'));
expect(dir).toBe(path.join(getDefaultClaudeConfigDir(), 'projects'));
});
});