Skip to content

Commit 9468299

Browse files
committed
fix: tests
1 parent 1551be3 commit 9468299

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

src/context/context.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ describe("context tests", () => {
190190
},
191191
timeout: "7d", // default timeout
192192
timeoutHeaders: {
193-
"Content-Type": ["application/json"],
193+
"content-type": ["application/json"],
194194
"Upstash-Feature-Set": ["LazyFetch,InitialBody"],
195195
[`Upstash-Forward-${WORKFLOW_PROTOCOL_VERSION_HEADER}`]: ["1"],
196196
[WORKFLOW_PROTOCOL_VERSION_HEADER]: [WORKFLOW_PROTOCOL_VERSION],

src/serve/serve.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ describe("serve", () => {
121121
execute: async (initialPayload, steps, first) => {
122122
const request = first
123123
? new Request(WORKFLOW_ENDPOINT, {
124-
body: JSON.stringify(initialPayload),
125-
method: "POST",
126-
})
124+
body: JSON.stringify(initialPayload),
125+
method: "POST",
126+
})
127127
: getRequest(WORKFLOW_ENDPOINT, workflowRunId, initialPayload, steps);
128128

129129
const response = await endpoint(request);
@@ -728,7 +728,7 @@ describe("serve", () => {
728728
timeout: "10d",
729729
timeoutHeaders: {
730730
"Upstash-Workflow-Sdk-Version": ["1"],
731-
"Content-Type": ["application/json"],
731+
"content-type": ["application/json"],
732732
"Upstash-Feature-Set": ["LazyFetch,InitialBody"],
733733
"Upstash-Forward-Upstash-Workflow-Sdk-Version": ["1"],
734734
"Upstash-Retries": ["3"],

src/workflow-requests.test.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ describe("Workflow Requests", () => {
455455
[WORKFLOW_FEATURE_HEADER]: "LazyFetch,InitialBody",
456456
[WORKFLOW_PROTOCOL_VERSION_HEADER]: WORKFLOW_PROTOCOL_VERSION,
457457
[`Upstash-Forward-${WORKFLOW_PROTOCOL_VERSION_HEADER}`]: WORKFLOW_PROTOCOL_VERSION,
458+
"content-type": "application/json",
458459
});
459460
expect(timeoutHeaders).toBeUndefined();
460461
});
@@ -482,6 +483,7 @@ describe("Workflow Requests", () => {
482483
[WORKFLOW_FEATURE_HEADER]: "LazyFetch,InitialBody",
483484
[WORKFLOW_PROTOCOL_VERSION_HEADER]: WORKFLOW_PROTOCOL_VERSION,
484485
[`Upstash-Forward-${WORKFLOW_PROTOCOL_VERSION_HEADER}`]: WORKFLOW_PROTOCOL_VERSION,
486+
"content-type": "application/json",
485487
});
486488
expect(timeoutHeaders).toBeUndefined();
487489
});
@@ -533,6 +535,7 @@ describe("Workflow Requests", () => {
533535
"Upstash-Callback-Workflow-Url": WORKFLOW_ENDPOINT,
534536
"Upstash-Forward-my-custom-header": "my-custom-header-value",
535537
"Upstash-Workflow-CallType": "toCallback",
538+
"content-type": "application/json",
536539
});
537540
expect(timeoutHeaders).toBeUndefined();
538541
});
@@ -555,6 +558,7 @@ describe("Workflow Requests", () => {
555558
[`Upstash-Forward-${WORKFLOW_PROTOCOL_VERSION_HEADER}`]: WORKFLOW_PROTOCOL_VERSION,
556559
[`Upstash-Failure-Callback-Forward-${WORKFLOW_FAILURE_HEADER}`]: "true",
557560
"Upstash-Failure-Callback": failureUrl,
561+
"content-type": "application/json",
558562
});
559563
expect(timeoutHeaders).toBeUndefined();
560564
});
@@ -581,6 +585,7 @@ describe("Workflow Requests", () => {
581585
[WORKFLOW_FEATURE_HEADER]: "LazyFetch,InitialBody",
582586
"Upstash-Forward-Upstash-Workflow-Sdk-Version": "1",
583587
"Upstash-Workflow-CallType": "step",
588+
"content-type": "application/json",
584589
});
585590
expect(timeoutHeaders).toEqual({
586591
"Upstash-Workflow-Init": ["false"],
@@ -591,7 +596,7 @@ describe("Workflow Requests", () => {
591596
"Upstash-Forward-Upstash-Workflow-Sdk-Version": ["1"],
592597
"Upstash-Workflow-Runid": [workflowRunId],
593598
"Upstash-Workflow-CallType": ["step"],
594-
"Content-Type": ["application/json"],
599+
"content-type": ["application/json"],
595600
});
596601
});
597602
});
@@ -870,6 +875,7 @@ describe("Workflow Requests", () => {
870875
"Upstash-Forward-Upstash-Workflow-Sdk-Version": "1",
871876
"Upstash-Retries": "0",
872877
"Upstash-Failure-Callback-Retries": "0",
878+
"content-type": "application/json",
873879
},
874880
requestPayload: undefined,
875881
url: WORKFLOW_ENDPOINT,

src/workflow-requests.ts

-1
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,6 @@ export const getHeaders = ({
525525
[WORKFLOW_INIT_HEADER]: ["false"],
526526
[WORKFLOW_URL_HEADER]: [workflowUrl],
527527
"Upstash-Workflow-CallType": ["step"],
528-
"Content-Type": [contentType],
529528
},
530529
};
531530
}

0 commit comments

Comments
 (0)