MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / getText

Function getText

__tests__/scripts/static-server.test.ts:89–107  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

87 }
88
89 async function getText(url: string) {
90 return new Promise<{ status: number; body: string }>((resolve, reject) => {
91 const req = request(url, { method: "GET" }, (res) => {
92 let body = "";
93 res.setEncoding("utf8");
94 res.on("data", (chunk) => {
95 body += chunk;
96 });
97 res.on("end", () => {
98 resolve({
99 status: res.statusCode ?? 0,
100 body,
101 });
102 });
103 });
104 req.on("error", reject);
105 req.end();
106 });
107 }
108
109 describe("parseArgs", () => {
110 it("defaults sessionApiKey to null", () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected