MCPcopy Index your code
hub / github.com/cli-table/cli-table3 / printExample

Function printExample

lib/print-example.js:103–114  ·  view source on GitHub ↗

* Called by every test/demo * @param name - the name of this test. * @param makeTable - a function which builds the table under test. Also, The contents of this function will be printed. * @param expected - The expected result. * @param screenshot - If present, there is an image contain

(name, makeTable, expected, screenshot)

Source from the content-addressed store, hash-verified

101 * @param screenshot - If present, there is an image containing a screenshot of the output
102 */
103 function printExample(name, makeTable, expected, screenshot) {
104 let code = makeTable.toString().split('\n').slice(1, -2).join('\n');
105
106 logName(name);
107 if (screenshot && logScreenShot) {
108 logScreenShot(screenshot);
109 } else {
110 logTable(makeTable().toString());
111 }
112 logCode(code);
113 logSeparator('\n');
114 }
115
116 fn(printExample);
117}

Callers

nothing calls this directly

Calls 2

toStringMethod · 0.80
makeTableFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…