mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-23 06:54:13 +08:00
Fix agent test to handle dynamic branch names from environment
This commit is contained in:
@@ -120,12 +120,13 @@ describe("Agent Mode", () => {
|
|||||||
expect(callArgs[1]).toContain("--mcp-config");
|
expect(callArgs[1]).toContain("--mcp-config");
|
||||||
expect(callArgs[1]).toContain("--model claude-sonnet-4 --max-turns 10");
|
expect(callArgs[1]).toContain("--model claude-sonnet-4 --max-turns 10");
|
||||||
|
|
||||||
// Verify return structure
|
// Verify return structure - branch will be whatever is in env or "main" as fallback
|
||||||
|
const expectedBranch = process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF_NAME || "main";
|
||||||
expect(result).toEqual({
|
expect(result).toEqual({
|
||||||
commentId: undefined,
|
commentId: undefined,
|
||||||
branchInfo: {
|
branchInfo: {
|
||||||
baseBranch: "main",
|
baseBranch: "main",
|
||||||
currentBranch: "main",
|
currentBranch: expectedBranch,
|
||||||
claudeBranch: undefined,
|
claudeBranch: undefined,
|
||||||
},
|
},
|
||||||
mcpConfig: expect.any(String),
|
mcpConfig: expect.any(String),
|
||||||
|
|||||||
Reference in New Issue
Block a user