* Build a persistor wired to `adapter` with a spy `applyMessages` callback so * tests can assert what (if anything) gets re-applied to the client.
(adapter: ChatClientPersistence, id: string = CHAT_ID)
| 28 | * tests can assert what (if anything) gets re-applied to the client. |
| 29 | */ |
| 30 | function createPersistor(adapter: ChatClientPersistence, id: string = CHAT_ID) { |
| 31 | const applyMessages = vi.fn<(messages: Array<UIMessage>) => void>() |
| 32 | const persistor = new ChatPersistor(adapter, id, applyMessages) |
| 33 | return { persistor, applyMessages } |
| 34 | } |
| 35 | |
| 36 | // --- typed StreamChunk fixtures ------------------------------------------- |
| 37 | // These satisfy the StreamChunk union directly (no casts). The persistor only |
no outgoing calls
no test coverage detected