MCPcopy Index your code
hub / github.com/EvoMap/evolver / populateFakeInstall

Function populateFakeInstall

test/forceUpdateKeepList.test.js:142–166  ·  view source on GitHub ↗
(root)

Source from the content-addressed store, hash-verified

140}
141
142function populateFakeInstall(root) {
143 // Package identity (required by the guard at the top of executeForceUpdate)
144 fs.writeFileSync(
145 path.join(root, 'package.json'),
146 JSON.stringify({ name: '@evomap/evolver', version: '1.0.0' }),
147 'utf8',
148 );
149 // Old code that MUST be replaced
150 fs.writeFileSync(path.join(root, 'index.js'), '// old', 'utf8');
151 fs.mkdirSync(path.join(root, 'src'), { recursive: true });
152 fs.writeFileSync(path.join(root, 'src', 'evolve.js'), '// old', 'utf8');
153 // Classic keep-list entries (must survive)
154 fs.mkdirSync(path.join(root, 'node_modules'), { recursive: true });
155 fs.mkdirSync(path.join(root, 'memory'), { recursive: true });
156 fs.mkdirSync(path.join(root, '.git'), { recursive: true });
157 fs.writeFileSync(path.join(root, 'MEMORY.md'), '# mem\n', 'utf8');
158 // New keep-list entries (must survive after this fix)
159 fs.writeFileSync(path.join(root, '.env'), 'A2A_HUB_URL=https://hub.example.com\nA2A_NODE_SECRET=s3cr3t\n', 'utf8');
160 fs.writeFileSync(path.join(root, '.env.local'), 'DEBUG=1\n', 'utf8');
161 fs.writeFileSync(path.join(root, 'USER.md'), '# my notes\n', 'utf8');
162 fs.mkdirSync(path.join(root, '.evolver'), { recursive: true });
163 fs.writeFileSync(path.join(root, '.evolver', 'config.json'), '{"workspaceId":"wid_test"}', 'utf8');
164 fs.mkdirSync(path.join(root, 'logs'), { recursive: true });
165 fs.writeFileSync(path.join(root, 'logs', 'evolver.log'), 'local log\n', 'utf8');
166}
167
168function assertPrivateArchiveDownload(execStub) {
169 const downloadCall = execStub.calls.find((c) => c.bin === process.execPath);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected