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

Function removeBlankErrorLine

packages/jest-message-util/src/index.ts:506–512  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

504const errorRegexp = /^Error:?\s*$/;
505
506const removeBlankErrorLine = (str: string) =>
507 str
508 .split('\n')
509 // Lines saying just `Error:` are useless
510 .filter(line => !errorRegexp.test(line))
511 .join('\n')
512 .trimEnd();
513
514// jasmine and worker farm sometimes don't give us access to the actual
515// Error object, so we have to regexp out the message from the stack string

Callers 1

separateMessageFromStackFunction · 0.85

Calls 1

testMethod · 0.45

Tested by

no test coverage detected