Skip to content

Commit 17cc5f7

Browse files
committed
fix(agent): mock buildAuthHeaders in tests for CI compatibility
1 parent 5a8752f commit 17cc5f7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

apps/sim/executor/handlers/agent/agent-handler.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,21 @@ vi.mock('@/providers', () => ({
6161
}),
6262
}))
6363

64+
vi.mock('@/executor/utils/http', () => ({
65+
buildAuthHeaders: vi.fn().mockResolvedValue({ 'Content-Type': 'application/json' }),
66+
buildAPIUrl: vi.fn().mockImplementation((path: string, params?: Record<string, string>) => {
67+
const url = new URL(path, 'http://localhost:3000')
68+
if (params) {
69+
for (const [key, value] of Object.entries(params)) {
70+
if (value !== undefined && value !== null) {
71+
url.searchParams.set(key, value)
72+
}
73+
}
74+
}
75+
return url
76+
}),
77+
}))
78+
6479
vi.mock('@sim/db', () => ({
6580
db: {
6681
select: vi.fn().mockReturnValue({

0 commit comments

Comments
 (0)