From c83d315d527c5bd96ddcee1d7823494f6b410f1a Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Wed, 9 Jun 2021 01:35:26 +0000 Subject: [PATCH] Build/Test Tools: Silence jQuery Migrate console warnings when running E2E tests. These warnings will still be visible in the browser console. The majority of the warnings are coming from jQuery UI, which is still waiting for a new update to be released that is jQuery >= 3.0 friendly. This change makes the E2E test results more readable without having to tread through the large number of warnings. Props isabel_brison. Fixes #52860. git-svn-id: https://develop.svn.wordpress.org/trunk@51130 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/e2e/config/bootstrap.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/e2e/config/bootstrap.js b/tests/e2e/config/bootstrap.js index 83c9ada3f7..3a767b21b0 100644 --- a/tests/e2e/config/bootstrap.js +++ b/tests/e2e/config/bootstrap.js @@ -33,7 +33,6 @@ const pageEvents = []; // The Jest timeout is increased because these tests are a bit slow jest.setTimeout( PUPPETEER_TIMEOUT || 100000 ); - /** * Adds an event listener to the page to handle additions of page event * handlers, to assure that they are removed at test teardown. @@ -72,6 +71,12 @@ function observeConsoleLogging() { return; } + // An exception is made for jQuery migrate console warnings output by + // the unminified script loaded in development environments. + if ( text.includes( 'JQMIGRATE' ) ) { + return; + } + // Viewing posts on the front end can result in this error, which // has nothing to do with Gutenberg. if ( text.includes( 'net::ERR_UNKNOWN_URL_SCHEME' ) ) {