Skip to content

Commit 931a497

Browse files
committed
style(mcp): format auth recovery tests
1 parent 89d26e0 commit 931a497

2 files changed

Lines changed: 25 additions & 12 deletions

File tree

‎src/mcp/client-auth-policy.test.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,11 @@ await mockMcpOAuthProviderModule(async (options: { serverURL: string }) => {
143143
return authProvider;
144144
});
145145

146-
const { connectMCPServer, fetchWithConnectAbort, MCP_HTTP_RECONNECTION_OPTIONS } =
147-
await import("./client.js");
146+
const {
147+
connectMCPServer,
148+
fetchWithConnectAbort,
149+
MCP_HTTP_RECONNECTION_OPTIONS,
150+
} = await import("./client.js");
148151

149152
describe("HTTP MCP auth policy", () => {
150153
beforeEach(() => {

‎src/mcp/client-auth-reauth-cap.test.ts‎

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,8 @@ describe("HTTP MCP re-auth loop prevention", () => {
446446
});
447447
mock.redirectsPerFailure = 0;
448448
mock.callFailuresLeft = 1;
449-
const first = callText(connected.client,
449+
const first = callText(
450+
connected.client,
450451
"first",
451452
{},
452453
new AbortController().signal,
@@ -455,7 +456,8 @@ describe("HTTP MCP re-auth loop prevention", () => {
455456

456457
mock.redirectsPerFailure = 1;
457458
mock.callFailuresLeft = 1;
458-
const second = callText(connected.client,
459+
const second = callText(
460+
connected.client,
459461
"second",
460462
{},
461463
new AbortController().signal,
@@ -485,7 +487,8 @@ describe("HTTP MCP re-auth loop prevention", () => {
485487
mock.callFailuresLeft = 2;
486488
const firstAbort = new AbortController();
487489
const first = callText(connected.client, "first", {}, firstAbort.signal);
488-
const second = callText(connected.client,
490+
const second = callText(
491+
connected.client,
489492
"second",
490493
{},
491494
new AbortController().signal,
@@ -576,7 +579,8 @@ describe("HTTP MCP re-auth loop prevention", () => {
576579
expect(connected.ok).toBe(true);
577580
if (!connected.ok) return;
578581
mock.callFailuresLeft = 1;
579-
const call = callText(connected.client,
582+
const call = callText(
583+
connected.client,
580584
"ping",
581585
{},
582586
new AbortController().signal,
@@ -598,7 +602,8 @@ describe("HTTP MCP re-auth loop prevention", () => {
598602
mock.refreshGate = new Promise(() => undefined);
599603
mock.redirectsPerFailure = 0;
600604
mock.callFailuresLeft = 1;
601-
const call = callText(connected.client,
605+
const call = callText(
606+
connected.client,
602607
"ping",
603608
{},
604609
new AbortController().signal,
@@ -622,7 +627,8 @@ describe("HTTP MCP re-auth loop prevention", () => {
622627
expect(connected.ok).toBe(true);
623628
if (!connected.ok) return;
624629
mock.callFailuresLeft = 1;
625-
const call = callText(connected.client,
630+
const call = callText(
631+
connected.client,
626632
"ping",
627633
{},
628634
new AbortController().signal,
@@ -650,12 +656,14 @@ describe("HTTP MCP re-auth loop prevention", () => {
650656
mock.releaseRetry = resolve;
651657
});
652658
mock.callFailuresLeft = 2;
653-
const first = callText(connected.client,
659+
const first = callText(
660+
connected.client,
654661
"first",
655662
{},
656663
new AbortController().signal,
657664
);
658-
const second = callText(connected.client,
665+
const second = callText(
666+
connected.client,
659667
"second",
660668
{},
661669
new AbortController().signal,
@@ -666,7 +674,8 @@ describe("HTTP MCP re-auth loop prevention", () => {
666674
mock.refreshSucceeds = true;
667675
mock.redirectsPerFailure = 0;
668676
mock.callFailuresLeft = 1;
669-
const third = callText(connected.client,
677+
const third = callText(
678+
connected.client,
670679
"third",
671680
{},
672681
new AbortController().signal,
@@ -922,7 +931,8 @@ describe("HTTP MCP re-auth loop prevention", () => {
922931
});
923932
mock.redirectsPerFailure = 0;
924933
mock.callFailuresLeft = 1;
925-
const first = callText(connected.client,
934+
const first = callText(
935+
connected.client,
926936
"first",
927937
{},
928938
new AbortController().signal,

0 commit comments

Comments
 (0)