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

Method write

packages/jest-console/src/BufferedConsole.ts:44–68  ·  view source on GitHub ↗
(
    this: void,
    buffer: ConsoleBuffer,
    type: LogType,
    message: LogMessage,
    stackLevel = 2,
  )

Source from the content-addressed store, hash-verified

42 }
43
44 static write(
45 this: void,
46 buffer: ConsoleBuffer,
47 type: LogType,
48 message: LogMessage,
49 stackLevel = 2,
50 ): ConsoleBuffer {
51 const rawStack = new ErrorWithStack(undefined, BufferedConsole.write).stack;
52
53 invariant(rawStack != null, 'always have a stack trace');
54
55 const origin = rawStack
56 .split('\n')
57 .slice(stackLevel)
58 .filter(Boolean)
59 .join('\n');
60
61 buffer.push({
62 message,
63 origin,
64 type,
65 });
66
67 return buffer;
68 }
69
70 private _log(type: LogType, message: LogMessage) {
71 BufferedConsole.write(

Callers 15

watchFunction · 0.80
startRunFunction · 0.80
onKeypressFunction · 0.80
onCancelPatternPromptFunction · 0.80
printSuiteFunction · 0.80
processResultsFunction · 0.80
runJestFunction · 0.80
_clearTestSummaryMethod · 0.80
_drawUIDoneMethod · 0.80
_drawUIProgressMethod · 0.80
_clearTestSummaryMethod · 0.80

Calls 1

invariantFunction · 0.90

Tested by

no test coverage detected