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

Function logTestError

build-system/tasks/visual-diff/index.js:223–243  ·  view source on GitHub ↗

* Logs a test error (regardless of where it's running). * * @param {!TestErrorDef} testError object as created by addTestError.

(testError)

Source from the content-addressed store, hash-verified

221 * @param {!TestErrorDef} testError object as created by addTestError.
222 */
223function logTestError(testError) {
224 log(
225 'error',
226 'Error in test',
227 yellow(testError.name),
228 '\n ',
229 testError.message,
230 '\n ',
231 testError.error
232 );
233 if (testError.consoleMessages.length > 0) {
234 log(
235 'error',
236 cyan(testError.consoleMessages.length),
237 'Console messages in the browser so far:'
238 );
239 for (const message of testError.consoleMessages) {
240 log('error', cyan(`[console.${message.type()}]`), message.text());
241 }
242 }
243}
244
245/**
246 * Sets the AMP config, launches a server, and generates Percy snapshots for a

Callers 1

addTestErrorFunction · 0.85

Calls 5

yellowFunction · 0.85
cyanFunction · 0.85
typeMethod · 0.80
logFunction · 0.70
textMethod · 0.45

Tested by

no test coverage detected