Skip to content

Commit 5efe04b

Browse files
authored
fix(deps): upgrade Puppeteer upgrade (#624)
1 parent e067064 commit 5efe04b

15 files changed

+417
-44
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"express": "^4.17.1",
3131
"html-minifier": "^4.0.0",
3232
"lighthouse": "^9.6.3",
33-
"puppeteer": "^18.0.0"
33+
"puppeteer": "^24.8.2"
3434
},
3535
"engines": {
3636
"node": ">=18.14.0"

src/e2e/fail-threshold-onpostbuild.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ describe('lighthousePlugin with failed threshold run (onPostBuild)', () => {
3434

3535
it('should output expected log content', async () => {
3636
const logs = [
37+
'Restoring Lighthouse cache...',
38+
'Lighthouse cache restored',
3739
'Generating Lighthouse report. This may take a minute…',
3840
'Running Lighthouse on example/',
3941
'Serving and scanning site from directory example',
@@ -43,6 +45,8 @@ describe('lighthousePlugin with failed threshold run (onPostBuild)', () => {
4345
'- Best Practices: 100',
4446
'- SEO: 91',
4547
'- PWA: 30',
48+
'Persisting Lighthouse cache...',
49+
'Lighthouse cache persisted',
4650
];
4751

4852
await lighthousePlugin({

src/e2e/fail-threshold-onsuccess.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ describe('lighthousePlugin with failed threshold run (onSuccess)', () => {
3434

3535
it('should output expected log content', async () => {
3636
const logs = [
37+
'Restoring Lighthouse cache...',
38+
'Lighthouse cache restored',
3739
'Generating Lighthouse report. This may take a minute…',
3840
'Running Lighthouse on /',
3941
'Lighthouse scores for /',
@@ -42,6 +44,8 @@ describe('lighthousePlugin with failed threshold run (onSuccess)', () => {
4244
'- Best Practices: 100',
4345
'- SEO: 91',
4446
'- PWA: 30',
47+
'Persisting Lighthouse cache...',
48+
'Lighthouse cache persisted',
4549
];
4650

4751
await lighthousePlugin().onSuccess({ utils: mockUtils });

src/e2e/fixture/utils.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ const mockUtils = {
66
status: {
77
show: jest.fn(),
88
},
9+
cache: {
10+
save: jest.fn(),
11+
restore: jest.fn(),
12+
},
913
};
1014

1115
export default mockUtils;

src/e2e/mocks/puppeteer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ const puppeteer = () =>
22
jest.unstable_mockModule('puppeteer', () => {
33
return {
44
default: {
5-
createBrowserFetcher: () => ({
6-
localRevisions: () => Promise.resolve(['123']),
7-
revisionInfo: () => Promise.resolve({ executablePath: 'path' }),
5+
launch: () => ({
6+
process: () => ({ spawnfile: 'path' }),
7+
close: () => Promise.resolve(),
88
}),
99
},
1010
};

src/e2e/not-found-onpostbuild.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,15 @@ describe('lighthousePlugin with single not-found run (onPostBuild)', () => {
2525

2626
it('should output expected log content', async () => {
2727
const logs = [
28+
'Restoring Lighthouse cache...',
29+
'Lighthouse cache restored',
2830
'Generating Lighthouse report. This may take a minute…',
2931
'Running Lighthouse on example/this-page-does-not-exist',
3032
'Serving and scanning site from directory example',
3133
'ERRORED_DOCUMENT_REQUEST',
3234
'Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 404)',
35+
'Persisting Lighthouse cache...',
36+
'Lighthouse cache persisted',
3337
];
3438

3539
await lighthousePlugin({

src/e2e/not-found-onsuccess.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,14 @@ describe('lighthousePlugin with single not-found run (onSuccess)', () => {
2525

2626
it('should output expected log content', async () => {
2727
const logs = [
28+
'Restoring Lighthouse cache...',
29+
'Lighthouse cache restored',
2830
'Generating Lighthouse report. This may take a minute…',
2931
'Running Lighthouse on /this-page-does-not-exist',
3032
'ERRORED_DOCUMENT_REQUEST',
3133
'Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 404)',
34+
'Persisting Lighthouse cache...',
35+
'Lighthouse cache persisted',
3236
];
3337

3438
await lighthousePlugin().onSuccess({ utils: mockUtils });

src/e2e/settings-locale.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ describe('lighthousePlugin with custom locale', () => {
3535

3636
it('should output expected log content', async () => {
3737
const logs = [
38+
'Restoring Lighthouse cache...',
39+
'Lighthouse cache restored',
3840
'Generating Lighthouse report. This may take a minute…',
3941
'Running Lighthouse on / using the “es” locale',
4042
'Lighthouse scores for /',
@@ -43,6 +45,8 @@ describe('lighthousePlugin with custom locale', () => {
4345
'- Prácticas recomendadas: 100',
4446
'- SEO: 91',
4547
'- PWA: 30',
48+
'Persisting Lighthouse cache...',
49+
'Lighthouse cache persisted',
4650
];
4751

4852
await lighthousePlugin().onSuccess({ utils: mockUtils });

src/e2e/settings-preset.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ describe('lighthousePlugin with custom device preset', () => {
2929

3030
it('should output expected log content', async () => {
3131
const logs = [
32+
'Restoring Lighthouse cache...',
33+
'Lighthouse cache restored',
3234
'Generating Lighthouse report. This may take a minute…',
3335
'Running Lighthouse on / using the “desktop” preset',
3436
'Lighthouse scores for /',
@@ -37,6 +39,8 @@ describe('lighthousePlugin with custom device preset', () => {
3739
'- Best Practices: 100',
3840
'- SEO: 91',
3941
'- PWA: 30',
42+
'Persisting Lighthouse cache...',
43+
'Lighthouse cache persisted',
4044
];
4145
await lighthousePlugin().onSuccess({ utils: mockUtils });
4246
expect(formatMockLog(console.log.mock.calls)).toEqual(logs);

src/e2e/success-onpostbuild.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ describe('lighthousePlugin with single report per run (onPostBuild)', () => {
2424

2525
it('should output expected log content', async () => {
2626
const logs = [
27+
'Restoring Lighthouse cache...',
28+
'Lighthouse cache restored',
29+
2730
'Generating Lighthouse report. This may take a minute…',
2831
'Running Lighthouse on example/',
2932
'Serving and scanning site from directory example',
@@ -33,6 +36,8 @@ describe('lighthousePlugin with single report per run (onPostBuild)', () => {
3336
'- Best Practices: 100',
3437
'- SEO: 91',
3538
'- PWA: 30',
39+
'Persisting Lighthouse cache...',
40+
'Lighthouse cache persisted',
3641
];
3742
await lighthousePlugin({
3843
fail_deploy_on_score_thresholds: 'true',

0 commit comments

Comments
 (0)