MCPcopy Create free account
hub / github.com/vitest-dev/vitest / parseErrorStacktrace

Function parseErrorStacktrace

packages/vitest/src/node/printError.ts:79–105  ·  view source on GitHub ↗
(error)

Source from the content-addressed store, hash-verified

77 screenshotPaths: options.screenshotPaths,
78 printProperties: options.verbose,
79 parseErrorStacktrace(error) {
80 if (error.stacks) {
81 if (options.fullStack) {
82 return error.stacks
83 }
84 else {
85 return error.stacks.filter((stack) => {
86 return !defaultStackIgnorePatterns.some(p => stack.file.match(p))
87 })
88 }
89 }
90
91 // browser stack trace needs to be processed differently,
92 // so there is a separate method for that
93 if (options.task?.file.pool === 'browser' && project.browser) {
94 return project.browser.parseErrorStacktrace(error, {
95 frameFilter: project.config.onStackTrace,
96 ignoreStackEntries: options.fullStack ? [] : undefined,
97 })
98 }
99
100 // node.js stack trace already has correct source map locations
101 return parseErrorStacktrace(error, {
102 frameFilter: project.config.onStackTrace,
103 ignoreStackEntries: options.fullStack ? [] : undefined,
104 })
105 },
106 })
107}
108

Callers

nothing calls this directly

Calls 4

parseErrorStacktraceFunction · 0.90
filterMethod · 0.65
matchMethod · 0.45
parseErrorStacktraceMethod · 0.45

Tested by

no test coverage detected