Skip to content

Commit 70cdaf2

Browse files
committed
test(api): assert vertex abort signal identity
1 parent 3f07ac2 commit 70cdaf2

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/api/providers/__tests__/anthropic-vertex.spec.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -914,9 +914,13 @@ describe("VertexHandler", () => {
914914
;(handler["client"].messages as any).create = mockCreate
915915

916916
await handler.completePrompt("test prompt", { abortSignal: controller.signal })
917-
expect(mockCreate).toHaveBeenCalledWith(expect.objectContaining({ model: expect.any(String) }), {
918-
signal: controller.signal,
919-
})
917+
918+
const [, requestOptions] = mockCreate.mock.calls[0]
919+
expect(mockCreate).toHaveBeenCalledWith(
920+
expect.objectContaining({ model: expect.any(String) }),
921+
expect.any(Object),
922+
)
923+
expect(requestOptions.signal).toBe(controller.signal)
920924
})
921925

922926
it("should work without options (backward compatible)", async () => {

0 commit comments

Comments
 (0)