MCPcopy Create free account
hub / github.com/EvoMap/evolver / responseFromText

Function responseFromText

test/lifecycleLastUpdateAck.test.js:258–266  ·  view source on GitHub ↗
({ status = 400, body = '', headers = {} } = {})

Source from the content-addressed store, hash-verified

256// ---------------------------------------------------------------------------
257
258function responseFromText({ status = 400, body = '', headers = {} } = {}) {
259 return {
260 ok: status >= 200 && status < 300,
261 status,
262 headers: { get: (k) => headers[k.toLowerCase()] || headers[k] || null },
263 json: async () => { try { return JSON.parse(body); } catch { return {}; } },
264 text: async () => body,
265 };
266}
267
268test('lifecycle heartbeat: 400 naming last_update clears the state file (and still reports failure)', async () => {
269 const originalFetch = global.fetch;

Callers 1

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected