From 07a9a6c6c0827137ceafabc41a741a147032c0ce Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Sun, 16 Aug 2026 11:35:17 -0700 Subject: [PATCH] Update NTLM auth tests for the new send() response shape (#567) --- plugins/auth-ntlm/tests/index.test.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/plugins/auth-ntlm/tests/index.test.ts b/plugins/auth-ntlm/tests/index.test.ts index c6c1b60b..2c447576 100644 --- a/plugins/auth-ntlm/tests/index.test.ts +++ b/plugins/auth-ntlm/tests/index.test.ts @@ -24,10 +24,12 @@ describe("auth-ntlm", () => { test("uses NTLM challenge when Negotiate and NTLM headers are separate", async () => { const send = vi.fn().mockResolvedValue({ - headers: [ - { name: "WWW-Authenticate", value: "Negotiate" }, - { name: "WWW-Authenticate", value: "NTLM TlRMTVNTUAACAAAAAA==" }, - ], + httpResponse: { + headers: [ + { name: "WWW-Authenticate", value: "Negotiate" }, + { name: "WWW-Authenticate", value: "NTLM TlRMTVNTUAACAAAAAA==" }, + ], + }, }); const ctx = { httpRequest: { send } } as unknown as Context; @@ -48,7 +50,9 @@ describe("auth-ntlm", () => { test("uses NTLM challenge when auth schemes are comma-separated in one header", async () => { const send = vi.fn().mockResolvedValue({ - headers: [{ name: "www-authenticate", value: "Negotiate, NTLM TlRMTVNTUAACAAAAAA==" }], + httpResponse: { + headers: [{ name: "www-authenticate", value: "Negotiate, NTLM TlRMTVNTUAACAAAAAA==" }], + }, }); const ctx = { httpRequest: { send } } as unknown as Context; @@ -68,7 +72,7 @@ describe("auth-ntlm", () => { test("throws a clear error when NTLM challenge is missing", async () => { const send = vi.fn().mockResolvedValue({ - headers: [{ name: "WWW-Authenticate", value: "Negotiate" }], + httpResponse: { headers: [{ name: "WWW-Authenticate", value: "Negotiate" }] }, }); const ctx = { httpRequest: { send } } as unknown as Context;