MCPcopy Index your code
hub / github.com/nodejs/node / #handleTestReportEvent

Method #handleTestReportEvent

lib/internal/test_runner/reporter/spec.js:60–78  ·  view source on GitHub ↗
(type, data)

Source from the content-addressed store, hash-verified

58 return ArrayPrototypeJoin(results, '\n');
59 }
60 #handleTestReportEvent(type, data) {
61 const subtest = ArrayPrototypeShift(this.#stack); // This is the matching `test:start` event
62 if (subtest) {
63 assert(subtest.type === 'test:start');
64 assert(subtest.data.nesting === data.nesting);
65 assert(subtest.data.name === data.name);
66 }
67 let prefix = '';
68 while (this.#stack.length) {
69 // Report all the parent `test:start` events
70 const parent = ArrayPrototypePop(this.#stack);
71 assert(parent.type === 'test:start');
72 const msg = parent.data;
73 ArrayPrototypeUnshift(this.#reported, msg);
74 prefix += `${indent(msg.nesting)}${reporterUnicodeSymbolMap['arrow:right']}${msg.name}\n`;
75 }
76 const indentation = indent(data.nesting);
77 return `${formatTestReport(type, data, false, prefix, indentation)}\n`;
78 }
79 #handleEvent({ type, data }) {
80 switch (type) {
81 case 'test:fail':

Callers 1

#handleEventMethod · 0.95

Calls 3

formatTestReportFunction · 0.85
indentFunction · 0.70
assertFunction · 0.50

Tested by

no test coverage detected