|
1 | 1 | /* eslint-disable @typescript-eslint/no-unused-vars */
|
2 | 2 | /* eslint-disable @typescript-eslint/require-await */
|
3 |
| -import { describe, expect, spyOn, test } from "bun:test"; |
| 3 | +import { describe, expect, jest, spyOn, test } from "bun:test"; |
4 | 4 | import { serve } from ".";
|
5 | 5 | import {
|
6 | 6 | driveWorkflow,
|
@@ -133,9 +133,9 @@ describe("serve", () => {
|
133 | 133 | execute: async (initialPayload, steps, first) => {
|
134 | 134 | const request = first
|
135 | 135 | ? new Request(WORKFLOW_ENDPOINT, {
|
136 |
| - body: JSON.stringify(initialPayload), |
137 |
| - method: "POST", |
138 |
| - }) |
| 136 | + body: JSON.stringify(initialPayload), |
| 137 | + method: "POST", |
| 138 | + }) |
139 | 139 | : getRequest(WORKFLOW_ENDPOINT, workflowRunId, initialPayload, steps);
|
140 | 140 |
|
141 | 141 | request.headers.set(WORKFLOW_INVOKE_COUNT_HEADER, "2");
|
@@ -1017,10 +1017,17 @@ describe("serve", () => {
|
1017 | 1017 |
|
1018 | 1018 | describe("incorrect url will throw", () => {
|
1019 | 1019 | const qstashClient = new Client({ token: process.env.QSTASH_TOKEN! });
|
| 1020 | + |
| 1021 | + qstashClient.publish = jest.fn().mockImplementation(() => { |
| 1022 | + return { |
| 1023 | + messageId: "some-message-id", |
| 1024 | + deduplicationId: "some-deduplication-id", |
| 1025 | + }; |
| 1026 | + }); |
1020 | 1027 | const client = new WorkflowClient({ token: process.env.QSTASH_TOKEN! });
|
1021 | 1028 |
|
1022 | 1029 | test("allow http://", async () => {
|
1023 |
| - const url = "http://requestcatcher.com"; |
| 1030 | + const url = "http://some-website.com"; |
1024 | 1031 | const { handler } = serve(
|
1025 | 1032 | async (context) => {
|
1026 | 1033 | await context.sleep("sleeping", 1);
|
|
0 commit comments