Stand up a fake daemon on its own path: a valid hello as `version`, and the proof `proof` says.
(version: string, proof: FakeProof = 'valid')
| 44 | |
| 45 | /** Stand up a fake daemon on its own path: a valid hello as `version`, and the proof `proof` says. */ |
| 46 | async function fakeDaemon(version: string, proof: FakeProof = 'valid') { |
| 47 | const daemon = await startFakeDaemon('', { |
| 48 | socketPath: uniqueSocketPath(), |
| 49 | version, |
| 50 | proof, |
| 51 | // Answers each request with its method, so a test can tell the session reached it. |
| 52 | reply: (request) => ({ result: { echoed: request.method } }), |
| 53 | }); |
| 54 | cleanups.push(() => daemon.close()); |
| 55 | return daemon; |
| 56 | } |
| 57 | |
| 58 | describe('connectWithHello — socket is never left without an error listener (#974)', () => { |
| 59 | it('returns a socket that has an error listener and never throws on error', async () => { |
no test coverage detected