test: skip Claude ack test when Anthropic key missing

This commit is contained in:
Mohamed Boudra
2025-11-30 01:56:30 +00:00
parent 1adee92dd1
commit 3030287d14

View File

@@ -13,6 +13,16 @@ import {
import type { AgentStreamEventPayload } from "../../messages.js";
import type { AgentProvider, AgentSessionConfig, AgentStreamEvent, AgentTimelineItem } from "../agent-sdk-types.js";
const claudeIntegrationEnabled =
process.env.RUN_CLAUDE_AGENT_TESTS === "1" || Boolean(process.env.ANTHROPIC_API_KEY?.trim()?.length);
const describeClaudeIntegration = claudeIntegrationEnabled ? describe : describe.skip;
if (!claudeIntegrationEnabled) {
console.warn(
"Skipping ClaudeAgentClient integration tests. Set RUN_CLAUDE_AGENT_TESTS=1 and provide ANTHROPIC_API_KEY to enable them."
);
}
function tmpCwd(): string {
const dir = mkdtempSync(path.join(os.tmpdir(), "claude-agent-e2e-"));
try {