* 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)
| 72 | * @param fn a function which creates the test suite. |
| 73 | */ |
| 74 | function 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); |