File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414 - name : Set up Node.js
1515 uses : actions/setup-node@v3
1616 with :
17- node-version : 18
17+ node-version : 20
1818 check-latest : true
1919 cache : npm
2020
Original file line number Diff line number Diff line change 11// puppeteer_environment.js
2- import fs from 'fs' ;
2+ import { readFile } from 'fs/promises ' ;
33import os from 'os' ;
44import path from 'path' ;
55import puppeteer from 'puppeteer' ;
@@ -17,7 +17,7 @@ export default class PuppeteerEnvironment extends NodeEnvironment {
1717 async setup ( ) {
1818 await super . setup ( ) ;
1919 // get the wsEndpoint
20- const wsEndpoint = fs . readFileSync ( path . join ( DIR , 'wsEndpoint' ) , 'utf8' ) ;
20+ const wsEndpoint = await readFile ( path . join ( DIR , 'wsEndpoint' ) , 'utf8' ) ;
2121 if ( ! wsEndpoint ) {
2222 throw new Error ( 'wsEndpoint not found' ) ;
2323 }
@@ -30,9 +30,18 @@ export default class PuppeteerEnvironment extends NodeEnvironment {
3030 }
3131
3232 async teardown ( ) {
33+ // eslint-disable-next-line no-underscore-dangle
34+ if ( this . global . __BROWSER_GLOBAL__ ) {
35+ // eslint-disable-next-line no-underscore-dangle
36+ this . global . __BROWSER_GLOBAL__ . disconnect ( ) ;
37+ }
3338 await super . teardown ( ) ;
3439 }
3540
41+ getVmContext ( ) {
42+ return super . getVmContext ( ) ;
43+ }
44+
3645 runScript ( script ) {
3746 return super . runScript ( script ) ;
3847 }
You can’t perform that action at this time.
0 commit comments