-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: check for console errors and warnings in pptr tests #15516
Conversation
@@ -46,6 +46,8 @@ export class ViewerUIFeatures extends ReportUIFeatures { | |||
} | |||
|
|||
this._getI18nModule().then(async (i18nModule) => { | |||
if (!report.i18n?.icuMessagePaths) return; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
older LHRs were erroring, but in a non-fatal way since this is a loose promise.
I didn't prevent the loading of the i18n module because the test would need to exclude the warning Chrome emits on an unused preload directive, and this being a minor optimization for ancient LHRs I'd rather not further complicate the tests.
viewer/test/viewer-test-pptr.js
Outdated
pageErrors = []; | ||
// Expected errors. | ||
const errors = await claimErrors(); | ||
expect(errors).toHaveLength(3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these new errors expected because of the new timeout above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, they have always been printed to the console. Now the tests are checking console errors in addition to pageerror
.
Better error checking in these tests would have prevented #15515. All the pptr tests the listen for pageerror now also fail on console error/warning. There was also an issue of timing, which I resolved in this PR too w/ usage of promises and a method to "claim" the errors.