MCPcopy
hub / github.com/jestjs/jest / getTopFrame

Function getTopFrame

packages/jest-message-util/src/index.ts:322–339  ·  view source on GitHub ↗
(lines: Array<string>)

Source from the content-addressed store, hash-verified

320}
321
322export function getTopFrame(lines: Array<string>): Frame | null {
323 for (const line of lines) {
324 if (line.includes(PATH_NODE_MODULES) || line.includes(PATH_JEST_PACKAGES)) {
325 continue;
326 }
327
328 const parsedFrame = stackUtils.parseLine(line.trim());
329
330 if (parsedFrame && parsedFrame.file) {
331 if (parsedFrame.file.startsWith('file://')) {
332 parsedFrame.file = slash(fileURLToPath(parsedFrame.file));
333 }
334 return parsedFrame as Frame;
335 }
336 }
337
338 return null;
339}
340
341export function formatStackTrace(
342 stack: string,

Callers 4

#getMessageDetailsMethod · 0.90
_addSnapshotMethod · 0.90
formatStackTraceFunction · 0.85
messages.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected