From 7f4cca5feda99df8fa295d9b8fd69051a6cfb007 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 15 Feb 2026 04:29:09 +0000 Subject: [PATCH] Cover accepted https baseURL validation paths Co-authored-by: Eric Allam --- packages/ai/src/chatTransport.test.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/packages/ai/src/chatTransport.test.ts b/packages/ai/src/chatTransport.test.ts index f3218df06..4b47251bd 100644 --- a/packages/ai/src/chatTransport.test.ts +++ b/packages/ai/src/chatTransport.test.ts @@ -675,6 +675,17 @@ describe("TriggerChatTransport", function () { }).toThrowError("baseURL must not include query parameters or hash fragments"); }); + it("accepts https baseURL values without throwing", function () { + expect(function () { + new TriggerChatTransport({ + task: "chat-task", + accessToken: "pk_trigger", + baseURL: "https://api.trigger.dev/custom-prefix", + stream: "chat-stream", + }); + }).not.toThrow(); + }); + it("accepts uppercase http protocol in baseURL", async function () { let observedTriggerPath: string | undefined; let observedStreamPath: string | undefined; @@ -2914,6 +2925,17 @@ describe("TriggerChatTransport", function () { }).toThrowError("baseURL must not include query parameters or hash fragments"); }); + it("accepts https baseURL values from factory without throwing", function () { + expect(function () { + createTriggerChatTransport({ + task: "chat-task", + accessToken: "pk_trigger", + baseURL: "https://api.trigger.dev/custom-prefix", + stream: "chat-stream", + }); + }).not.toThrow(); + }); + it("continues streaming when onTriggeredRun callback throws", async function () { let callbackCalled = false; const errors: TriggerChatTransportError[] = [];