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
This commit is contained in:
Jonathan Desrosiers
2021-06-09 01:35:26 +00:00
parent 1c418298bf
commit c83d315d52

View File

@@ -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' ) ) {