(home, fn)
| 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 |
no test coverage detected