(overrides: Record<string, unknown> = {})
| 47 | } |
| 48 | |
| 49 | function tokenResponse(overrides: Record<string, unknown> = {}) { |
| 50 | return { |
| 51 | status: 200, |
| 52 | ok: true, |
| 53 | headers: new Headers({ 'Content-Type': 'application/json' }), |
| 54 | json: async () => ({ |
| 55 | status: 'success', |
| 56 | access_token: 'at-abcdef', |
| 57 | refresh_token: 'rt-abcdef', |
| 58 | expired_in: Date.now() + 86_400_000, |
| 59 | ...overrides, |
| 60 | }), |
| 61 | } as Response; |
| 62 | } |
| 63 | |
| 64 | function errorResponse(status: number, body?: string) { |
| 65 | return { |
no outgoing calls
no test coverage detected