mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 21:38:25 +00:00
refactor(test): dedupe agent and discord test fixtures
This commit is contained in:
10
src/discord/test-http-helpers.ts
Normal file
10
src/discord/test-http-helpers.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export function jsonResponse(body: unknown, status = 200): Response {
|
||||
return new Response(JSON.stringify(body), { status });
|
||||
}
|
||||
|
||||
export function urlToString(url: Request | URL | string): string {
|
||||
if (typeof url === "string") {
|
||||
return url;
|
||||
}
|
||||
return "url" in url ? url.url : String(url);
|
||||
}
|
||||
Reference in New Issue
Block a user