()
| 134 | * Used to restore error level logging after each test. |
| 135 | */ |
| 136 | export function restoreConsoleError() { |
| 137 | consoleErrorSandbox.restore(); |
| 138 | if (expectedAsyncErrors.length > 0) { |
| 139 | const helpMessage = |
| 140 | 'The test "' + |
| 141 | testName + |
| 142 | '" called "expectAsyncConsoleError", ' + |
| 143 | 'but there were no call(s) to console.error with these message(s): ' + |
| 144 | '"' + |
| 145 | expectedAsyncErrors.join('", "') + |
| 146 | '"'; |
| 147 | testRunner.test.error(new Error(helpMessage)); |
| 148 | } |
| 149 | expectedAsyncErrors = []; |
| 150 | } |
| 151 | |
| 152 | /** |
| 153 | * Used to silence info, log, and warn level logging during each test, unless |
no test coverage detected