File tree Expand file tree Collapse file tree 4 files changed +353
-37
lines changed Expand file tree Collapse file tree 4 files changed +353
-37
lines changed Original file line number Diff line number Diff line change 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"
Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ const puppeteer = () =>
22 jest . unstable_mockModule ( 'puppeteer' , ( ) => {
33 return {
44 default : {
5+ launch : ( ) => {
6+ return { executablePath : ( ) => 'path' }
7+ } ,
58 createBrowserFetcher : ( ) => ( {
69 localRevisions : ( ) => Promise . resolve ( [ '123' ] ) ,
710 revisionInfo : ( ) => Promise . resolve ( { executablePath : 'path' } ) ,
Original file line number Diff line number Diff line change @@ -4,13 +4,12 @@ import log from 'lighthouse-logger';
44import chromeLauncher from 'chrome-launcher' ;
55
66export const getBrowserPath = async ( ) => {
7- const browserFetcher = puppeteer . createBrowserFetcher ( ) ;
8- const revisions = await browserFetcher . localRevisions ( ) ;
9- if ( revisions . length <= 0 ) {
10- throw new Error ( 'Could not find local browser' ) ;
11- }
12- const info = await browserFetcher . revisionInfo ( revisions [ 0 ] ) ;
13- return info . executablePath ;
7+ const browser = await puppeteer . launch ( {
8+ headless : "new" ,
9+ args : [ '--no-sandbox' , '--disable-gpu' , '--disable-dev-shm-usage' ]
10+ } ) ;
11+ const executablePath = browser . executablePath ( ) ;
12+ return executablePath ;
1413} ;
1514
1615export const runLighthouse = async ( browserPath , url , settings ) => {
You can’t perform that action at this time.
0 commit comments