| 30 | // lifecycle (remote subscribe/unsubscribe, per-subscription bookkeeping) is Index's |
| 31 | // job, exercised directly in test/bidi/index_test.js, not re-tested here. |
| 32 | function fakeBidi() { |
| 33 | return { |
| 34 | registered: undefined, |
| 35 | async addCallback(method, handler) { |
| 36 | this.registered = { method, handler } |
| 37 | return { id: 'sub-1', unsubscribe: async () => {} } |
| 38 | }, |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | describe('Domain addCallback', function () { |
| 43 | it('parses delivered payloads through the descriptor type before the handler runs', async function () { |