(windows, loaded, cachePath, cacheDest)
| 175 | |
| 176 | t.test('eacces/eperm', async t => { |
| 177 | const runTest = (windows, loaded, cachePath, cacheDest) => async t => { |
| 178 | const { errorMessage, logs, cache } = await loadMockNpm(t, { |
| 179 | windows, |
| 180 | load: loaded, |
| 181 | globals: windows ? { 'process.platform': 'win32' } : [], |
| 182 | }) |
| 183 | |
| 184 | const path = `${cachePath ? cache : '/not/cache/dir'}/path` |
| 185 | const dest = `${cacheDest ? cache : '/not/cache/dir'}/dest` |
| 186 | const er = Object.assign(new Error('whoopsie'), { |
| 187 | code: 'EACCES', |
| 188 | path, |
| 189 | dest, |
| 190 | stack: 'dummy stack trace', |
| 191 | }) |
| 192 | |
| 193 | t.matchSnapshot(errorMessage(er)) |
| 194 | t.matchSnapshot(logs.verbose) |
| 195 | } |
| 196 | |
| 197 | for (const windows of [true, false]) { |
| 198 | for (const loaded of [true, false]) { |
no test coverage detected
searching dependent graphs…