({ status = 426, body = '', headers = {} } = {})
| 160 | } |
| 161 | |
| 162 | function responseFromText({ status = 426, body = '', headers = {} } = {}) { |
| 163 | return { |
| 164 | ok: status >= 200 && status < 300, |
| 165 | status, |
| 166 | headers: { get: (k) => headers[k.toLowerCase()] || headers[k] || null }, |
| 167 | json: async () => { try { return JSON.parse(body); } catch { return {}; } }, |
| 168 | text: async () => body, |
| 169 | }; |
| 170 | } |
| 171 | |
| 172 | // Wait for the microtask spawned by _maybeTriggerForceUpdateFromHeartbeat |
| 173 | // (the Promise.resolve().then(...) block) to settle, AND for any chained |
no test coverage detected