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

Function withFixtureAppdata

test/evolveCollect.test.js:985–993  ·  view source on GitHub ↗
(home, fn)

Source from the content-addressed store, hash-verified

983 // non-existent paths and get filtered out by fs.existsSync. POSIX hosts
984 // are unaffected (resolveTranscriptDirs does not run the win32 branch).
985 function withFixtureAppdata(home, fn) {
986 const saved = process.env.APPDATA;
987 process.env.APPDATA = path.join(home, 'AppData', 'Roaming');
988 try { return fn(); }
989 finally {
990 if (saved === undefined) delete process.env.APPDATA;
991 else process.env.APPDATA = saved;
992 }
993 }
994
995 // Spawn a child node process with a pinned HOME so `os.homedir()`
996 // resolves to the fixture. The reader's module-level constants

Callers 1

Calls 1

fnFunction · 0.70

Tested by

no test coverage detected