MCPcopy Create free account
hub / github.com/nodejs/node / cleanErr

Function cleanErr

deps/npm/test/lib/utils/log-file.js:34–41  ·  view source on GitHub ↗
(message)

Source from the content-addressed store, hash-verified

32}
33
34const cleanErr = (message) => {
35 const err = new Error(message)
36 const stack = err.stack.split('\n')
37 err.stack = stack[0] + '\n' + range(10)
38 .map((__, i) => stack[1].replace(/^(\s+at\s).*/, `$1stack trace line ${i}`))
39 .join('\n')
40 return err
41}
42
43const loadLogFile = async (t, { buffer = [], mocks, testdir = {}, ...options } = {}) => {
44 const root = t.testdir(testdir)

Callers 1

log-file.jsFile · 0.85

Calls 4

rangeFunction · 0.70
mapMethod · 0.65
splitMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected