Cover trimmed wrapper query/hash validation path
Co-authored-by: Eric Allam <eric@trigger.dev>
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user