({ status = 400, body = '', headers = {} } = {})
| 256 | // --------------------------------------------------------------------------- |
| 257 | |
| 258 | function 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 | |
| 268 | test('lifecycle heartbeat: 400 naming last_update clears the state file (and still reports failure)', async () => { |
| 269 | const originalFetch = global.fetch; |
no test coverage detected