Skip to content

Commit 5ab504f

Browse files
committed
updated failing tests
1 parent a19415f commit 5ab504f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/testing/src/mocks/executor.mock.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,19 @@ vi.mock('@/executor/path')
7171
vi.mock('@/executor/resolver', () => ({
7272
InputResolver: vi.fn(),
7373
}))
74+
vi.mock('@/executor/utils/http', () => ({
75+
buildAuthHeaders: vi.fn().mockResolvedValue({ 'Content-Type': 'application/json' }),
76+
buildAPIUrl: vi.fn((path: string) => new URL(path, 'http://localhost:3000')),
77+
extractAPIErrorMessage: vi.fn(async (response: Response) => {
78+
const defaultMessage = `API request failed with status ${response.status}`
79+
try {
80+
const errorData = await response.json()
81+
return errorData.error || defaultMessage
82+
} catch {
83+
return defaultMessage
84+
}
85+
}),
86+
}))
7487

7588
// Specific block utilities
7689
vi.mock('@/blocks/blocks/router')

0 commit comments

Comments
 (0)