Make WordPress Core

Opened 7 months ago

Closed 5 months ago

Last modified 6 days ago

#52860 closed defect (bug) (fixed)

Ignore jquery migrate console warnings when running e2e tests

Reported by: isabel_brison Owned by: desrosj
Milestone: 5.8 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch has-unit-tests commit
Focuses: Cc:


When running e2e tests, console warnings generated by the jquery migrate script are output, creating a lot of noise that makes browsing the test results unnecessarily painful. E.g. this is output several times per test:

    JQMIGRATE: jQuery.isFunction() is deprecated

      113 |
      114 | 		// eslint-disable-next-line no-console
    > 115 | 		console[ logFunction ]( text );
          | 		^
      116 | 	} );
      117 | }
      118 |

      at config/bootstrap.js:115:3
      at ../../node_modules/puppeteer/lib/cjs/vendor/mitt/src/index.js:51:62
          at Array.map (<anonymous>)
      at Object.emit (../../node_modules/puppeteer/lib/cjs/vendor/mitt/src/index.js:51:43)
      at Page.emit (../../node_modules/puppeteer/lib/cjs/puppeteer/common/EventEmitter.js:72:22)
      at Page._addConsoleMessage (../../node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:757:14)
      at Page._onConsoleAPI (../../node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:700:14)

We should add something in the e2e setup to ignore these warnings.

Change History (7)

This ticket was mentioned in PR #1106 on WordPress/wordpress-develop by tellthemachines.

7 months ago

  • Keywords has-patch has-unit-tests added

#2 @SergeyBiryukov
7 months ago

  • Milestone changed from Awaiting Review to 5.8

#3 @desrosj
5 months ago

@isabel_brison are these errors being triggered by code within the devDependencies? Or within Core code? If the former, would ignoring these warnings result in deprecated patterns in Core code being missed? I know that jQuery Migrate is slated to be removed from Core eventually, but it's still included for the time being.

The 5.8 cutoff is today, but test improvements are allowed at any time, so this can stay for the time being.

#4 @isabel_brison
5 months ago

There's a couple uses of $.isFunction() in Twenty Seventeen, and the rest of the warnings are coming from jQuery UI. The warnings also appear in the browser console when running a dev environment though, so we won't miss them if we remove them from the e2e tests. And the benefit of removing them is the test results become much more readable, as all the warnings are currently being output after each test.

#5 @desrosj
5 months ago

  • Keywords commit added

Thanks for clarifying! I say let's get this in then.

#6 @desrosj
5 months ago

  • Owner set to desrosj
  • Resolution set to fixed
  • Status changed from new to closed

In 51130:

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.

Note: See TracTickets for help on using tickets.