MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / fakeDaemon

Function fakeDaemon

__tests__/proxy-connect.test.ts:46–56  ·  view source on GitHub ↗

Stand up a fake daemon on its own path: a valid hello as `version`, and the proof `proof` says.

(version: string, proof: FakeProof = 'valid')

Source from the content-addressed store, hash-verified

44
45/** Stand up a fake daemon on its own path: a valid hello as `version`, and the proof `proof` says. */
46async 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
58describe('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 () => {

Callers 1

Calls 4

startFakeDaemonFunction · 0.90
pushMethod · 0.80
uniqueSocketPathFunction · 0.70
closeMethod · 0.65

Tested by

no test coverage detected