Cover trimmed wrapper query/hash validation path

Co-authored-by: Eric Allam <eric@trigger.dev>
This commit is contained in:
Cursor Agent
2026-02-15 05:44:54 +00:00
parent c82bf64db2
commit 666b991926
+22
View File
@@ -841,6 +841,17 @@ describe("TriggerChatTransport", function () {
}).toThrowError("baseURL must not include query parameters or hash fragments");
});
it("throws query/hash validation after trimming wrapper whitespace", function () {
expect(function () {
new TriggerChatTransport({
task: "chat-task",
accessToken: "pk_trigger",
baseURL: " https://api.trigger.dev/base?query=1 ",
stream: "chat-stream",
});
}).toThrowError("baseURL must not include query parameters or hash fragments");
});
it("throws when baseURL includes hash fragments", function () {
expect(function () {
new TriggerChatTransport({
@@ -3426,6 +3437,17 @@ describe("TriggerChatTransport", function () {
}).toThrowError("baseURL must not include query parameters or hash fragments");
});
it("throws query/hash validation after trimming wrapper whitespace in factory", function () {
expect(function () {
createTriggerChatTransport({
task: "chat-task",
accessToken: "pk_trigger",
baseURL: " https://api.trigger.dev/base?query=1 ",
stream: "chat-stream",
});
}).toThrowError("baseURL must not include query parameters or hash fragments");
});
it("throws from factory when baseURL includes hash fragments", function () {
expect(function () {
createTriggerChatTransport({