(runner)
| 76 | // this reporter outputs test results, indenting two spaces per suite |
| 77 | class MyReporter { |
| 78 | constructor(runner) { |
| 79 | this._errors = [ ]; |
| 80 | this._indents = 1; |
| 81 | this._lastLog = getTime(); |
| 82 | this._lastPass = ""; |
| 83 | this._lastPrefix = null; |
| 84 | this._lastPrefixHeader = null; |
| 85 | this._testLogs = [ ]; |
| 86 | this._suiteLogs = [ ]; |
| 87 | this._prefixCount = 0; |
| 88 | const stats = runner.stats; |
| 89 | |
| 90 | runner.once(EVENT_RUN_BEGIN, () => { |
| 91 | |
| 92 | }).on(EVENT_SUITE_BEGIN, (suite) => { |
| 93 | this._suiteLogs.push([ ]); |
| 94 | suite._ethersLog = (text) => { |
| 95 | this._suiteLogs[this._suiteLogs.length - 1].push(getString(text)) |
| 96 | }; |
| 97 | if (suite.title.trim()) { |
| 98 | this.log(`<blue+>Suite: ${ escapeColor(suite.title) }`) |
| 99 | } |
| 100 | this.increaseIndent(); |
| 101 | |
| 102 | }).on(EVENT_SUITE_END, (suite) => { |
| 103 | this.flush(true); |
| 104 | this.decreaseIndent(); |
| 105 | const logs = this._suiteLogs.pop(); |
| 106 | if (logs.length) { |
| 107 | logs.join("\n").split("\n").forEach((line) => { |
| 108 | this.log(` <magenta+>>> <dim>${ escapeColor(line) }`); |
| 109 | }); |
| 110 | } |
| 111 | if (suite.title.trim()) { this.log(""); } |
| 112 | |
| 113 | }).on(EVENT_TEST_BEGIN, (test) => { |
| 114 | this._testLogs.push([ ]); |
| 115 | test._ethersLog = (text) => { |
| 116 | this._testLogs[this._testLogs.length - 1].push(getString(text)) |
| 117 | }; |
| 118 | |
| 119 | }).on(EVENT_TEST_END, (test) => { |
| 120 | const logs = this._testLogs.pop(); |
| 121 | if (logs.length) { |
| 122 | this.flush(false); |
| 123 | logs.join("\n").split("\n").forEach((line) => { |
| 124 | this.log(` <cyan+>>> <cyan->${ escapeColor(line) }`); |
| 125 | }); |
| 126 | } |
| 127 | |
| 128 | }).on(EVENT_TEST_PASS, (test) => { |
| 129 | this.addPass(test.title); |
| 130 | |
| 131 | }).on(EVENT_TEST_FAIL, (test, error) => { |
| 132 | this.flush(); |
| 133 | this._errors.push({ test, error }); |
| 134 | this.log( |
| 135 | ` [ <red+>fail(${ this._errors.length }): <red>${ escapeColor(test.title) } - <normal>${ escapeColor(error.message) } ]` |
nothing calls this directly
no test coverage detected