MCPcopy Create free account
hub / github.com/EvoMap/evolver / withFakeEvomapDir

Function withFakeEvomapDir

test/lifecycleNodeIdUnification.test.js:117–132  ·  view source on GitHub ↗
(dir, body)

Source from the content-addressed store, hash-verified

115// cache — otherwise `_shortNodeIdForStatePath` would short-circuit on
116// the cache before consulting the legacy file we are testing.
117async function withFakeEvomapDir(dir, body) {
118 const _origHome = process.env.EVOLVER_HOME;
119 const _origFetch = global.fetch;
120 process.env.EVOLVER_HOME = dir;
121 _resetCachedNodeIdForTesting();
122 try {
123 return await body();
124 } finally {
125 if (_origHome === undefined) delete process.env.EVOLVER_HOME;
126 else process.env.EVOLVER_HOME = _origHome;
127 global.fetch = _origFetch;
128 _resetCachedNodeIdForTesting();
129 _resetLastUpdateStateForTesting();
130 fs.rmSync(dir, { recursive: true, force: true });
131 }
132}
133
134test('proxy hello on a fresh install (no legacy file, no store) writes the minted id to ~/.evomap/node_id', async () => {
135 const dir = makeFakeEvomapDir();

Calls

no outgoing calls

Tested by

no test coverage detected