Build a stub client that returns the supplied details in order.
(details: HyperframesRenderDetail[])
| 20 | |
| 21 | /** Build a stub client that returns the supplied details in order. */ |
| 22 | function stubClient(details: HyperframesRenderDetail[]): HyperframesCloudClient { |
| 23 | const stack = [...details]; |
| 24 | return { |
| 25 | async getRender() { |
| 26 | const next = stack.shift(); |
| 27 | if (!next) throw new Error("ran out of stubbed responses"); |
| 28 | return next; |
| 29 | }, |
| 30 | } as unknown as HyperframesCloudClient; |
| 31 | } |
| 32 | |
| 33 | describe("cloud/poll", () => { |
| 34 | describe("isTerminal", () => { |