MCPcopy Index your code
hub / github.com/nodejs/node / runTest

Function runTest

deps/npm/test/lib/utils/error-message.js:177–195  ·  view source on GitHub ↗
(windows, loaded, cachePath, cacheDest)

Source from the content-addressed store, hash-verified

175
176t.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]) {

Callers 1

error-message.jsFile · 0.70

Calls 3

assignMethod · 0.80
loadMockNpmFunction · 0.70
errorMessageFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…