Skip to content

Commit 7f4cca5

Browse files
Cover accepted https baseURL validation paths
Co-authored-by: Eric Allam <eric@trigger.dev>
1 parent db22f32 commit 7f4cca5

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

packages/ai/src/chatTransport.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,17 @@ describe("TriggerChatTransport", function () {
675675
}).toThrowError("baseURL must not include query parameters or hash fragments");
676676
});
677677

678+
it("accepts https baseURL values without throwing", function () {
679+
expect(function () {
680+
new TriggerChatTransport({
681+
task: "chat-task",
682+
accessToken: "pk_trigger",
683+
baseURL: "https://api.trigger.dev/custom-prefix",
684+
stream: "chat-stream",
685+
});
686+
}).not.toThrow();
687+
});
688+
678689
it("accepts uppercase http protocol in baseURL", async function () {
679690
let observedTriggerPath: string | undefined;
680691
let observedStreamPath: string | undefined;
@@ -2914,6 +2925,17 @@ describe("TriggerChatTransport", function () {
29142925
}).toThrowError("baseURL must not include query parameters or hash fragments");
29152926
});
29162927

2928+
it("accepts https baseURL values from factory without throwing", function () {
2929+
expect(function () {
2930+
createTriggerChatTransport({
2931+
task: "chat-task",
2932+
accessToken: "pk_trigger",
2933+
baseURL: "https://api.trigger.dev/custom-prefix",
2934+
stream: "chat-stream",
2935+
});
2936+
}).not.toThrow();
2937+
});
2938+
29172939
it("continues streaming when onTriggeredRun callback throws", async function () {
29182940
let callbackCalled = false;
29192941
const errors: TriggerChatTransportError[] = [];

0 commit comments

Comments
 (0)