Minimal transport: captures the message handler so a test can drive it.
()
| 409 | describe('sessions sharing a daemon', () => { |
| 410 | /** Minimal transport: captures the message handler so a test can drive it. */ |
| 411 | function fakeTransport(): JsonRpcTransport & { deliver: (m: JsonRpcRequest) => Promise<void>; results: unknown[] } { |
| 412 | let handle: ((m: JsonRpcRequest | JsonRpcNotification) => Promise<void>) | null = null; |
| 413 | const results: unknown[] = []; |
| 414 | return { |
| 415 | start(h) { handle = h as typeof handle; }, |
| 416 | stop() { /* nothing to tear down */ }, |
| 417 | send() { /* unused */ }, |
| 418 | notify() { /* unused */ }, |
| 419 | async request() { return {}; }, |
| 420 | sendResult(_id, result) { results.push(result); }, |
| 421 | sendError() { /* unused */ }, |
| 422 | results, |
| 423 | async deliver(m: JsonRpcRequest) { await handle?.(m); }, |
| 424 | }; |
| 425 | } |
| 426 | |
| 427 | it('give each session its own state, and one session\'s calls stay there', async () => { |
| 428 | const calls: Array<ExploreSessionState | undefined> = []; |
no outgoing calls
no test coverage detected