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

Function runTest

lib/print-example.js:74–84  ·  view source on GitHub ↗

* Actually runs the tests and verifies the functions create the expected output. * @param name of the test suite, used in the mocha.describe call. * @param fn a function which creates the test suite.

(name, fn)

Source from the content-addressed store, hash-verified

72 * @param fn a function which creates the test suite.
73 */
74function runTest(name, fn) {
75 function testExample(name, fn, expected) {
76 it(name, function () {
77 expect(fn().toString()).toEqual(expected.join('\n'));
78 });
79 }
80
81 describe(name, function () {
82 fn(testExample, identity);
83 });
84}
85
86/**
87 * Common execution for runs that print output (either to console or to a Markdown file);

Callers 2

itFunction · 0.85
itFunction · 0.85

Calls

no outgoing calls

Tested by 2

itFunction · 0.68
itFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…