-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// this file is need for the Node 18 test | ||
|
||
import { Client } from "@upstash/qstash" | ||
import { serve } from "@upstash/workflow/nextjs" | ||
|
||
const qstashClient = new Client({ | ||
baseUrl: "https://workflow-tests.requestcatcher.com/", | ||
token: "mock" | ||
}) | ||
|
||
const { POST: serveHandler } = serve( | ||
async (context) => { | ||
await context.sleep("sleeping", 10) | ||
}, { | ||
qstashClient, | ||
receiver: undefined | ||
} | ||
) | ||
|
||
const request = new Request("https://workflow-tests.requestcatcher.com/") | ||
const response = await serveHandler(request) | ||
|
||
const status = response.status | ||
const body = await response.text() | ||
|
||
if (status !== 500) { | ||
throw new Error(`ci failed. incorrect status. status: ${status}, body: ${body}`) | ||
} | ||
if (body !== `{"error":"SyntaxError","message":"Unexpected token 'r', \\"request caught\\" is not valid JSON"}`) { | ||
throw new Error(`ci failed. incorrect body. status: ${status}, body: ${body}`) | ||
} | ||
console.log(">>> CI SUCCESFUL") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters