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

Function assertPrivateArchiveDownload

test/forceUpdateKeepList.test.js:168–190  ·  view source on GitHub ↗
(execStub)

Source from the content-addressed store, hash-verified

166}
167
168function assertPrivateArchiveDownload(execStub) {
169 const downloadCall = execStub.calls.find((c) => c.bin === process.execPath);
170 assert.ok(downloadCall, 'fallback should download via the current node binary');
171
172 const downloaderScript = downloadCall.args[1];
173 assert.match(
174 downloaderScript,
175 /fs\.createWriteStream\(dest,\{flags:'wx',mode:0o600\}\)/,
176 'fallback downloader should create the archive exclusively with owner-only permissions',
177 );
178
179 const archivePath = downloadCall.args[3];
180 const archiveDir = path.dirname(archivePath);
181 assert.equal(path.basename(archivePath), 'archive.tar.gz',
182 'fallback should use a fixed archive name inside a private directory');
183 assert.match(path.basename(archiveDir), /^\.evolver-update-archive-/,
184 'fallback archive directory should be mkdtemp-created');
185 assert.notEqual(archiveDir, os.tmpdir(),
186 'fallback should not write the archive directly under os.tmpdir()');
187 assert.doesNotMatch(path.basename(archivePath), /^\.evolver-update-\d+-\d+\.tar\.gz$/,
188 'fallback should not use the old predictable top-level archive filename');
189 assert.ok(!fs.existsSync(archiveDir), 'fallback should remove the private archive directory');
190}
191
192describe('executeForceUpdate: keep-list preserves user config files', () => {
193 before(() => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected