Files
claude-code-action/test/report-claude-complete.test.ts
Ashwin Bhat 52c2f5881b feat: add repository_dispatch event support
- Add new progress MCP server for reporting task status via API
- Support repository_dispatch events with task description and progress endpoint
- Introduce isDispatch flag to unify dispatch event handling
- Make GitHub data optional for dispatch events without issues/PRs
- Update prompt generation with dispatch-specific instructions

Enables triggering Claude via repository_dispatch with:
{
  "event_type": "claude_task",
  "client_payload": {
    "description": "Task description",
    "progress_endpoint": "https://api.example.com/progress"
  }
}
2025-08-05 10:56:07 -07:00

29 lines
944 B
TypeScript

import { describe, test, expect } from "bun:test";
import type { StreamConfig } from "../src/types/stream-config";
describe("report-claude-complete", () => {
test("StreamConfig type should include system_progress_endpoint", () => {
const config: StreamConfig = {
progress_endpoint: "https://example.com/progress",
system_progress_endpoint: "https://example.com/system-progress",
resume_endpoint: "https://example.com/resume",
session_id: "test-session",
headers: {
Authorization: "Bearer test-token",
},
};
expect(config.system_progress_endpoint).toBe(
"https://example.com/system-progress",
);
});
test("StreamConfig type should allow optional fields", () => {
const config: StreamConfig = {};
expect(config.system_progress_endpoint).toBeUndefined();
expect(config.progress_endpoint).toBeUndefined();
expect(config.headers).toBeUndefined();
});
});