Cover accepted https baseURL validation paths

Co-authored-by: Eric Allam <eric@trigger.dev>
This commit is contained in:
Cursor Agent
2026-02-15 04:29:09 +00:00
parent db22f32e72
commit 7f4cca5fed
+22
View File
@@ -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[] = [];