Skip to content

Use Garry Tan's exact Claude Code setup: 23 opinionated tools that serve as CEO, Designer, Eng Manager, Release Manager, Doc Engineer, and QA

TypeScript

fix: fail fast on API connectivity — pre-check before E2E suite

Garry Tan9f5aa32e679d
diff --git a/test/skill-e2e.test.ts b/test/skill-e2e.test.ts
index ec4330544..be3c6ad23 100644
--- a/test/skill-e2e.test.ts
+++ b/test/skill-e2e.test.ts
@@ -5,6 +5,7 @@ import { outcomeJudge } from './helpers/llm-judge';
import { EvalCollector } from './helpers/eval-store';
import type { EvalTestEntry } from './helpers/eval-store';
import { startTestServer } from '../browse/test/test-server';
+import { spawnSync } from 'child_process';
import * as fs from 'fs';
import * as path from 'path';
import * as os from 'os';
@@ -116,6 +117,17 @@ function dumpOutcomeDiagnostic(dir: string, label: string, report: string, judge
} catch { /* non-fatal */ }
}
+// Fail fast if Anthropic API is unreachable — don't burn through 13 tests getting ConnectionRefused
+if (evalsEnabled) {
+ const check = spawnSync('sh', ['-c', 'echo "ping" | claude -p --max-turns 1 --output-format stream-json --verbose --dangerously-skip-permissions'], {
+ stdio: 'pipe', timeout: 30_000,
+ });
+ const output = check.stdout?.toString() || '';
+ if (output.includes('ConnectionRefused') || output.includes('Unable to connect')) {
+ throw new Error('Anthropic API unreachable — aborting E2E suite. Fix connectivity and retry.');
+ }
+}
+
describeE2E('Skill E2E tests', () => {
beforeAll(() => {
testServer = startTestServer();