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

Function extractMessage

e2e/__tests__/declarationErrors.test.ts:11–21  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

9import runJest from '../runJest';
10
11const extractMessage = (str: string) =>
12 extractSummary(str)
13 .rest.replaceAll(
14 // circus-jasmine normalization
15 /.+addSpecsToSuite (.+:\d+:\d+).+\n/g,
16 '',
17 )
18 .match(
19 // all lines from the first to the last mentioned "describe" after the "●" line
20 /●(.|\n)*?\n(?<lines>.*describe((.|\n)*describe)*.*)(\n|$)/imu,
21 )?.groups?.lines ?? '';
22
23it('errors if describe returns a Promise', () => {
24 const result = runJest('declaration-errors', [

Callers 1

Calls 2

extractSummaryFunction · 0.90
matchMethod · 0.80

Tested by

no test coverage detected