Skip to content

Commit 6b3b50e

Browse files
authored
feat: upgrade to lighthouse 12.6.1 (#1103)
BREAKING CHANGE: upgrade to lighthouse 12.6.1
1 parent 912d985 commit 6b3b50e

File tree

14 files changed

+60362
-254
lines changed

14 files changed

+60362
-254
lines changed

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"proxy-agent": "^6.4.0",
2222
"inquirer": "^6.3.1",
2323
"isomorphic-fetch": "^3.0.0",
24-
"lighthouse": "12.1.0",
24+
"lighthouse": "12.6.1",
2525
"lighthouse-logger": "1.2.0",
2626
"open": "^7.1.0",
2727
"tmp": "^0.1.0",

packages/cli/test/assert.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ describe('Lighthouse CI assert CLI', () => {
5555
it('should run the recommended preset', async () => {
5656
const result = await run([`--preset=lighthouse:recommended`]);
5757
expect(result.status).toEqual(1);
58-
expect(result.failures.length).toMatchInlineSnapshot(`108`);
59-
expect(result.warnings.length).toMatchInlineSnapshot(`16`);
58+
expect(result.failures.length).toMatchInlineSnapshot(`125`);
59+
expect(result.warnings.length).toMatchInlineSnapshot(`19`);
6060
expect(result.passes.length).toMatchInlineSnapshot(`0`);
6161
expect(result.failures).toContain('deprecations failure');
6262
expect(result.failures).toContain('viewport failure');
@@ -65,8 +65,8 @@ describe('Lighthouse CI assert CLI', () => {
6565
it('should run the no-pwa preset', async () => {
6666
const result = await run([`--preset=lighthouse:no-pwa`]);
6767
expect(result.status).toEqual(1);
68-
expect(result.failures.length).toMatchInlineSnapshot(`107`);
69-
expect(result.warnings.length).toMatchInlineSnapshot(`15`);
68+
expect(result.failures.length).toMatchInlineSnapshot(`124`);
69+
expect(result.warnings.length).toMatchInlineSnapshot(`18`);
7070
expect(result.passes.length).toMatchInlineSnapshot(`0`);
7171
expect(result.failures).toContain('deprecations failure');
7272
expect(result.failures).not.toContain('viewport failure');
@@ -91,8 +91,8 @@ describe('Lighthouse CI assert CLI', () => {
9191
it('should return passing audits', async () => {
9292
const result = await run([`--preset=lighthouse:recommended`, '--include-passed-assertions']);
9393
expect(result.status).toEqual(1);
94-
expect(result.warnings.length).toMatchInlineSnapshot(`16`);
95-
expect(result.failures.length).toMatchInlineSnapshot(`108`);
94+
expect(result.warnings.length).toMatchInlineSnapshot(`19`);
95+
expect(result.failures.length).toMatchInlineSnapshot(`125`);
9696
expect(result.passes.length).toMatchInlineSnapshot(`1`);
9797
expect(result.passes).toContain('first-contentful-paint passing');
9898
expect(result.failures).toContain('viewport failure');

packages/server/src/ui/routes/build-view/audit-detail/audit-detail-pane.stories.jsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import lhr1140A_ from '../../../../../test/fixtures/lh-11-4-0-coursehero-a.json'
2828
import lhr1140B_ from '../../../../../test/fixtures/lh-11-4-0-coursehero-b.json';
2929
import lhr1200A_ from '../../../../../test/fixtures/lh-12-0-0-coursehero-a.json';
3030
import lhr1200B_ from '../../../../../test/fixtures/lh-12-0-0-coursehero-b.json';
31+
import lhr1261A_ from '../../../../../test/fixtures/lh-12-6-1-coursehero-a.json';
32+
import lhr1261B_ from '../../../../../test/fixtures/lh-12-6-1-coursehero-b.json';
3133
import lhrSubitemsA_ from '../../../../../test/fixtures/lh-subitems-a.json';
3234
import lhrSubitemsB_ from '../../../../../test/fixtures/lh-subitems-b.json';
3335
import lhrPsi800A_ from '../../../../../test/fixtures/psi-8-0-0-dkdev-a.json';
@@ -58,6 +60,8 @@ const lhr1140A = /** @type {any} */ (lhr1140A_);
5860
const lhr1140B = /** @type {any} */ (lhr1140B_);
5961
const lhr1200A = /** @type {any} */ (lhr1200A_);
6062
const lhr1200B = /** @type {any} */ (lhr1200B_);
63+
const lhr1261A = /** @type {any} */ (lhr1261A_);
64+
const lhr1261B = /** @type {any} */ (lhr1261B_);
6165
const lhrSubitemsA = /** @type {any} */ (lhrSubitemsA_);
6266
const lhrSubitemsB = /** @type {any} */ (lhrSubitemsB_);
6367
const lhrPsi800A = /** @type {any} */ (lhrPsi800A_);
@@ -73,6 +77,7 @@ const auditPairs930 = createAuditPairs(lhr930A, lhr930B);
7377
const auditPairs1010 = createAuditPairs(lhr1010A, lhr1010B);
7478
const auditPairs1140 = createAuditPairs(lhr1140A, lhr1140B);
7579
const auditPairs1200 = createAuditPairs(lhr1200A, lhr1200B);
80+
const auditPairs1261 = createAuditPairs(lhr1261A, lhr1261B);
7681
const auditPairsPsi800 = createAuditPairs(lhrPsi800A, lhrPsi800B);
7782
const auditPairsSubitems = createAuditPairs(lhrSubitemsA, lhrSubitemsB, {
7883
filter: pair =>
@@ -175,6 +180,15 @@ export const Version1200 = () => (
175180
/>
176181
);
177182

183+
export const Version1261 = () => (
184+
<AuditDetailPane
185+
selectedAuditId={auditPairs1261[1].audit.id || ''}
186+
setSelectedAuditId={action('setSelectedAuditId')}
187+
pairs={auditPairs1261}
188+
baseLhr={lhr1261B}
189+
/>
190+
);
191+
178192
export const VersionPsi800 = () => (
179193
<AuditDetailPane
180194
selectedAuditId={auditPairsPsi800[1].audit.id || ''}

packages/server/src/ui/routes/build-view/lhr-comparison.stories.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ import lhr1140A_ from '../../../../test/fixtures/lh-11-4-0-coursehero-a.json';
2626
import lhr1140B_ from '../../../../test/fixtures/lh-11-4-0-coursehero-b.json';
2727
import lhr1200A_ from '../../../../test/fixtures/lh-12-0-0-coursehero-a.json';
2828
import lhr1200B_ from '../../../../test/fixtures/lh-12-0-0-coursehero-b.json';
29+
import lhr1261A_ from '../../../../test/fixtures/lh-12-6-1-coursehero-a.json';
30+
import lhr1261B_ from '../../../../test/fixtures/lh-12-6-1-coursehero-b.json';
2931
import lhrPsi800A_ from '../../../../test/fixtures/psi-8-0-0-dkdev-a.json';
3032
import lhrPsi800B_ from '../../../../test/fixtures/psi-8-0-0-dkdev-b.json';
3133

@@ -54,6 +56,8 @@ const lhr1140A = /** @type {any} */ (lhr1140A_);
5456
const lhr1140B = /** @type {any} */ (lhr1140B_);
5557
const lhr1200A = /** @type {any} */ (lhr1200A_);
5658
const lhr1200B = /** @type {any} */ (lhr1200B_);
59+
const lhr1261A = /** @type {any} */ (lhr1261A_);
60+
const lhr1261B = /** @type {any} */ (lhr1261B_);
5761
const lhrPsi800A = /** @type {any} */ (lhrPsi800A_);
5862
const lhrPsi800B = /** @type {any} */ (lhrPsi800B_);
5963

@@ -120,6 +124,12 @@ export const Version1200 = () => (
120124
</Wrapper>
121125
);
122126

127+
export const Version1261 = () => (
128+
<Wrapper>
129+
<LhrComparison lhr={lhr1261A} baseLhr={lhr1261B} hookElements={{}} />
130+
</Wrapper>
131+
);
132+
123133
export const VersionPsi800 = () => (
124134
<Wrapper>
125135
<LhrComparison lhr={lhrPsi800A} baseLhr={lhrPsi800B} hookElements={{}} />

packages/server/test/api/statistic-definitions.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ const baselhr1010_ = require('../fixtures/lh-10-1-0-coursehero-a.json');
2727
const baselhr1140_ = require('../fixtures/lh-11-4-0-coursehero-a.json');
2828
/** @type {any} */
2929
const baselhr1200_ = require('../fixtures/lh-12-0-0-coursehero-a.json');
30+
/** @type {any} */
31+
const baselhr1261_ = require('../fixtures/lh-12-6-1-coursehero-a.json');
3032
const {definitions} = require('../../src/api/statistic-definitions.js');
3133

3234
describe('Statistic Definitions', () => {
@@ -50,6 +52,8 @@ describe('Statistic Definitions', () => {
5052
const baselhr1140 = baselhr1140_;
5153
/** @type {LH.Result} */
5254
const baselhr1200 = baselhr1200_;
55+
/** @type {LH.Result} */
56+
const baselhr1261 = baselhr1261_;
5357

5458
describe('meta_lighthouse_version()', () => {
5559
const run = definitions.meta_lighthouse_version;
@@ -65,6 +69,7 @@ describe('Statistic Definitions', () => {
6569
expect(run([baselhr1010])).toEqual({value: 100100});
6670
expect(run([baselhr1140])).toEqual({value: 110400});
6771
expect(run([baselhr1200])).toEqual({value: 120000});
72+
expect(run([baselhr1261])).toEqual({value: 120601});
6873
expect(run([{...baseLhr5, lighthouseVersion: '1.2.3-beta.0'}])).toEqual({value: 10203});
6974
});
7075

@@ -92,6 +97,7 @@ describe('Statistic Definitions', () => {
9297
expect(run([high, baselhr1010, low]).value).toBeCloseTo(21627.392);
9398
expect(run([high, baselhr1140, low]).value).toBeCloseTo(80796.283);
9499
expect(run([high, baselhr1200, low]).value).toBeCloseTo(82970.673);
100+
expect(run([high, baselhr1261, low]).value).toBeCloseTo(84118.687);
95101
});
96102
});
97103

@@ -113,6 +119,7 @@ describe('Statistic Definitions', () => {
113119
expect(run([high, baselhr1010, low]).value).toBeCloseTo(0.21);
114120
expect(run([high, baselhr1140, low]).value).toBeCloseTo(0.32);
115121
expect(run([high, baselhr1200, low]).value).toBeCloseTo(0.34);
122+
expect(run([high, baselhr1261, low]).value).toBeCloseTo(0.27);
116123
});
117124
});
118125

@@ -134,6 +141,7 @@ describe('Statistic Definitions', () => {
134141
expect(run([high, baselhr1010, low]).value).toBeCloseTo(0.01);
135142
expect(run([high, baselhr1140, low]).value).toBeCloseTo(0.01);
136143
expect(run([high, baselhr1200, low]).value).toBeCloseTo(0.01);
144+
expect(run([high, baselhr1261, low]).value).toBeCloseTo(0.01);
137145
});
138146
});
139147

@@ -155,6 +163,7 @@ describe('Statistic Definitions', () => {
155163
expect(run([high, baselhr1010, low]).value).toBeCloseTo(0.99);
156164
expect(run([high, baselhr1140, low]).value).toBeCloseTo(0.99);
157165
expect(run([high, baselhr1200, low]).value).toBeCloseTo(0.99);
166+
expect(run([high, baselhr1261, low]).value).toBeCloseTo(0.99);
158167
});
159168
});
160169

@@ -170,6 +179,7 @@ describe('Statistic Definitions', () => {
170179
expect(definitions['auditgroup_a11y-aria_pass']([baselhr1010])).toEqual({value: 8});
171180
expect(definitions['auditgroup_a11y-aria_pass']([baselhr1140])).toEqual({value: 9});
172181
expect(definitions['auditgroup_a11y-aria_pass']([baselhr1200])).toEqual({value: 12});
182+
expect(definitions['auditgroup_a11y-aria_pass']([baselhr1261])).toEqual({value: 12});
173183
expect(definitions['auditgroup_a11y-color-contrast_fail']([baseLhr5])).toEqual({value: 0});
174184
expect(definitions['auditgroup_a11y-color-contrast_fail']([baseLhr6])).toEqual({value: 1});
175185
expect(definitions['auditgroup_a11y-color-contrast_fail']([baseLhr62])).toEqual({value: 1});
@@ -180,6 +190,7 @@ describe('Statistic Definitions', () => {
180190
expect(definitions['auditgroup_a11y-color-contrast_fail']([baselhr1010])).toEqual({value: 1});
181191
expect(definitions['auditgroup_a11y-color-contrast_fail']([baselhr1140])).toEqual({value: 1});
182192
expect(definitions['auditgroup_a11y-color-contrast_fail']([baselhr1200])).toEqual({value: 1});
193+
expect(definitions['auditgroup_a11y-color-contrast_fail']([baselhr1261])).toEqual({value: 1});
183194
expect(definitions['auditgroup_a11y-aria_na']([baseLhr5])).toEqual({value: 0});
184195
expect(definitions['auditgroup_a11y-aria_na']([baseLhr6])).toEqual({value: 2});
185196
expect(definitions['auditgroup_a11y-aria_na']([baseLhr62])).toEqual({value: 2});
@@ -190,6 +201,7 @@ describe('Statistic Definitions', () => {
190201
expect(definitions['auditgroup_a11y-aria_na']([baselhr1010])).toEqual({value: 9});
191202
expect(definitions['auditgroup_a11y-aria_na']([baselhr1140])).toEqual({value: 9});
192203
expect(definitions['auditgroup_a11y-aria_na']([baselhr1200])).toEqual({value: 9});
204+
expect(definitions['auditgroup_a11y-aria_na']([baselhr1261])).toEqual({value: 9});
193205
});
194206
});
195207
});

0 commit comments

Comments
 (0)