MCPcopy
hub / github.com/ampproject/amphtml / restoreConsoleError

Function restoreConsoleError

testing/console-logging-setup.js:136–150  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

134 * Used to restore error level logging after each test.
135 */
136export 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

Callers 1

cleanupTestcaseFunction · 0.90

Calls 2

restoreMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected