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 node-version : ' 20'
1515 - name : Install deps (with cache)
1616 uses : bahmutov/npm-install@v1
17+ - name : Build
18+ run : yarn build
19+ - name : Install Puppeteer browser
20+ run : npx puppeteer browsers install chrome
1721 - name : Test codebase
18- run : yarn test
22+ run : yarn test --run
1923 - name : Upload coverage
2024 uses : codecov/codecov-action@v2
2125 - name : Typecheck codebase
Original file line number Diff line number Diff line change @@ -156,9 +156,25 @@ describe('Browser tests with Puppeteer', () => {
156156 } )
157157 page = await browser . newPage ( )
158158
159+ const errors : string [ ] = [ ]
160+ page . on ( 'pageerror' , err => errors . push ( err . message ) )
161+ page . on ( 'console' , msg => {
162+ if ( msg . type ( ) === 'error' ) {
163+ errors . push ( msg . text ( ) )
164+ }
165+ } )
166+
159167 await page . goto ( `http://localhost:${ appPort } /` )
160- await page . waitForFunction ( 'window.ready === true' )
161- } )
168+
169+ try {
170+ await page . waitForFunction ( 'window.ready === true' , { timeout : 10000 } )
171+ } catch ( e ) {
172+ const html = await page . content ( )
173+ console . error ( 'Page errors:' , errors )
174+ console . error ( 'Page HTML:' , html )
175+ throw e
176+ }
177+ } , 30000 )
162178
163179 afterAll ( async ( ) => {
164180 await browser ?. close ( )
You can’t perform that action at this time.
0 commit comments