Skip to content

Commit 6097a51

Browse files
committed
test(providers): stub the destination check in the cursor-reset case
The other successful-PUT cases in this file already spy providerDestinationResolvedError to null. Without it the commit path does a real DNS lookup for alpha.example.test, which passes the file alone and fails under a full tests/providers run.
1 parent f593498 commit 6097a51

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎tests/providers/provider-config-batch-management.test.ts‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,15 @@ describe("atomic provider editor batch", () => {
402402
baseline.providers.alpha!.apiKeyPoolStrategy = "round-robin";
403403
const next = structuredClone(baseline);
404404
next.providers.alpha!.defaultModel = "alpha-new";
405-
const response = await putBatch(loadConfig(), { baseline, next });
406-
expect(response?.status).toBe(200);
405+
// Same seam the other successful-PUT cases use: the destination check would otherwise do a
406+
// real DNS lookup for alpha.example.test on the commit path.
407+
const destinationSpy = spyOn(destinationPolicy, "providerDestinationResolvedError").mockResolvedValue(null);
408+
try {
409+
const response = await putBatch(loadConfig(), { baseline, next });
410+
expect(response?.status).toBe(200);
411+
} finally {
412+
destinationSpy.mockRestore();
413+
}
407414

408415
// The PUT cleared the cooldowns, so key one is eligible again. Cool only the committed key
409416
// and point the selection back at it, the same way as above.

0 commit comments

Comments
 (0)