Skip to content

Commit

Permalink
deps(puppeteer): upgrade to 13.7.0 (#13657)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed May 3, 2022
1 parent 990a57a commit 131ea58
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 179 deletions.
10 changes: 8 additions & 2 deletions lighthouse-core/fraggle-rock/gather/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class ProtocolSession {
/** @param {LH.Puppeteer.CDPSession} session */
const listener = session => callback(new ProtocolSession(session));
this._callbackMap.set(callback, listener);
this._session.connection().on('sessionattached', listener);
this._getConnection().on('sessionattached', listener);
}

/**
Expand All @@ -106,7 +106,7 @@ class ProtocolSession {
removeSessionAttachedListener(callback) {
const listener = this._callbackMap.get(callback);
if (!listener) return;
this._session.connection().off('sessionattached', listener);
this._getConnection().off('sessionattached', listener);
}

/**
Expand Down Expand Up @@ -171,6 +171,12 @@ class ProtocolSession {
this._session.removeAllListeners();
await this._session.detach();
}

_getConnection() {
const connection = this._session.connection();
if (!connection) throw new Error('Connection has been closed.');
return connection;
}
}

module.exports = ProtocolSession;
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
"pako": "^2.0.3",
"preact": "^10.5.14",
"pretty-json-stringify": "^0.0.2",
"puppeteer": "10.2.0",
"puppeteer": "13.7.0",
"resolve": "^1.20.0",
"rollup": "^2.52.7",
"rollup-plugin-node-resolve": "^5.2.0",
Expand Down Expand Up @@ -199,7 +199,7 @@
"open": "^8.4.0",
"parse-cache-control": "1.0.1",
"ps-list": "^8.0.0",
"puppeteer-core": "^10.2.0",
"puppeteer-core": "^13.7.0",
"robots-parser": "^3.0.0",
"semver": "^5.3.0",
"speedline-core": "^1.4.3",
Expand Down
104 changes: 6 additions & 98 deletions report/test/renderer/__snapshots__/report-renderer-axe-test.js.snap
Original file line number Diff line number Diff line change
@@ -1,107 +1,15 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`ReportRendererAxe with aXe renders without axe violations 2`] = `
exports[`ReportRendererAxe with aXe renders without axe violations 1`] = `
Array [
Object {
"description": "Ensures every id attribute value is unique",
"help": "id attribute value must be unique",
"helpUrl": "https://dequeuniversity.com/rules/axe/4.4/duplicate-id?application=axeAPI",
"id": "duplicate-id",
"impact": "minor",
"nodes": Array [
Object {
"all": Array [],
"any": Array [
Object {
"data": "viewport",
"id": "duplicate-id",
"impact": "minor",
"message": "Document has multiple static elements with the same id attribute: viewport",
"relatedNodes": Array [
Object {
"html": "<div class=\\"lh-audit lh-audit--binary lh-audit--pass\\" id=\\"viewport\\">",
"target": Array [
"#seo > .lh-audit-group:nth-child(4) > .lh-clump--passed.lh-clump > .lh-audit--binary.lh-audit--pass.lh-audit:nth-child(2)",
],
},
Object {
"html": "<div class=\\"lh-audit lh-audit--binary lh-audit--pass\\" id=\\"viewport\\">",
"target": Array [
".lh-audit-group--pwa-optimized > .lh-audit--binary.lh-audit--pass.lh-audit:nth-child(6)",
],
},
],
},
],
"failureSummary": "Fix any of the following:
Document has multiple static elements with the same id attribute: viewport",
"html": "<div class=\\"lh-audit lh-audit--binary lh-audit--pass\\" id=\\"viewport\\">",
"impact": "minor",
"none": Array [],
"target": Array [
".lh-audit--binary.lh-audit--pass.lh-audit:nth-child(20)",
],
},
Object {
"all": Array [],
"any": Array [
Object {
"data": "image-alt",
"id": "duplicate-id",
"impact": "minor",
"message": "Document has multiple static elements with the same id attribute: image-alt",
"relatedNodes": Array [
Object {
"html": "<div class=\\"lh-audit lh-audit--binary lh-audit--fail\\" id=\\"image-alt\\">",
"target": Array [
".lh-audit-group--seo-content > .lh-audit--fail.lh-audit--binary.lh-audit:nth-child(3)",
],
},
],
},
],
"failureSummary": "Fix any of the following:
Document has multiple static elements with the same id attribute: image-alt",
"html": "<div class=\\"lh-audit lh-audit--binary lh-audit--fail\\" id=\\"image-alt\\">",
"impact": "minor",
"none": Array [],
"target": Array [
".lh-audit-group--a11y-names-labels > .lh-audit--fail.lh-audit--binary.lh-audit:nth-child(2)",
],
},
Object {
"all": Array [],
"any": Array [
Object {
"data": "document-title",
"id": "duplicate-id",
"impact": "minor",
"message": "Document has multiple static elements with the same id attribute: document-title",
"relatedNodes": Array [
Object {
"html": "<div class=\\"lh-audit lh-audit--binary lh-audit--pass\\" id=\\"document-title\\">",
"target": Array [
"#seo > .lh-audit-group:nth-child(4) > .lh-clump--passed.lh-clump > .lh-audit--binary.lh-audit--pass.lh-audit:nth-child(3)",
],
},
],
},
],
"failureSummary": "Fix any of the following:
"message": "Fix any of the following:
Document has multiple static elements with the same id attribute: viewport
Fix any of the following:
Document has multiple static elements with the same id attribute: image-alt
Fix any of the following:
Document has multiple static elements with the same id attribute: document-title",
"html": "<div class=\\"lh-audit lh-audit--binary lh-audit--pass\\" id=\\"document-title\\">",
"impact": "minor",
"none": Array [],
"target": Array [
".lh-audit--binary.lh-audit--pass.lh-audit:nth-child(13)",
],
},
],
"tags": Array [
"cat.parsing",
"wcag2a",
"wcag411",
],
},
]
`;
18 changes: 3 additions & 15 deletions report/test/renderer/report-renderer-axe-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ describe('ReportRendererAxe', () => {
'heading-order': {enabled: true},
'meta-viewport': {enabled: true},
'aria-treeitem-name': {enabled: true},
// TODO: re-enable. https://github.com/GoogleChrome/lighthouse/issues/13918
'color-contrast': {enabled: false},
},
};

Expand Down Expand Up @@ -75,21 +77,7 @@ describe('ReportRendererAxe', () => {
message: v.nodes.map((n) => n.failureSummary).join('\n'),
};
});
expect(axeSummary).toMatchInlineSnapshot(`
Array [
Object {
"id": "duplicate-id",
"message": "Fix any of the following:
Document has multiple static elements with the same id attribute: viewport
Fix any of the following:
Document has multiple static elements with the same id attribute: image-alt
Fix any of the following:
Document has multiple static elements with the same id attribute: document-title",
},
]
`);

expect(axeResults.violations).toMatchSnapshot();
expect(axeSummary).toMatchSnapshot();
},
// This test takes 10s on fast hardware, but can take longer in CI.
// https://github.com/dequelabs/axe-core/tree/b573b1c1/doc/examples/jest_react#timeout-issues
Expand Down
Loading

0 comments on commit 131ea58

Please sign in to comment.