({ status = 200, json = {}, headers = {} } = {})
| 44 | } |
| 45 | |
| 46 | function responseFromJson({ status = 200, json = {}, headers = {} } = {}) { |
| 47 | return { |
| 48 | ok: status >= 200 && status < 300, |
| 49 | status, |
| 50 | headers: { get: (k) => headers[k.toLowerCase()] || headers[k] || null }, |
| 51 | json: async () => json, |
| 52 | text: async () => JSON.stringify(json), |
| 53 | }; |
| 54 | } |
| 55 | |
| 56 | test('lifecycle hello: sets _helloRateLimitUntil when hub returns 429', async () => { |
| 57 | const originalFetch = global.fetch; |
no outgoing calls
no test coverage detected