@@ -8,7 +8,7 @@ describe('lib/extend.ts', () => {
88 let document : puppeteer . ElementHandle
99
1010 it ( 'should launch puppeteer' , async ( ) => {
11- browser = await puppeteer . launch ( )
11+ browser = await puppeteer . launch ( { args : [ '--no-sandbox' , '--disable-setuid-sandbox' ] } )
1212 page = await browser . newPage ( )
1313 await page . goto ( `file://${ path . join ( __dirname , 'fixtures/page.html' ) } ` )
1414 } )
@@ -21,17 +21,20 @@ describe('lib/extend.ts', () => {
2121 it ( 'should handle the query* methods' , async ( ) => {
2222 const element = await document . queryByText ( 'Hello h1' )
2323 expect ( element ) . toBeTruthy ( )
24+ /* istanbul ignore next */
2425 expect ( await page . evaluate ( el => el . textContent , element ) ) . toEqual ( 'Hello h1' )
2526 } )
2627
2728 it ( 'should handle regex matching' , async ( ) => {
2829 const element = await document . queryByText ( / H e l l o / )
2930 expect ( element ) . toBeTruthy ( )
31+ /* istanbul ignore next */
3032 expect ( await page . evaluate ( el => el . textContent , element ) ) . toEqual ( 'Hello h1' )
3133 } )
3234
3335 it ( 'should handle the get* methods' , async ( ) => {
3436 const element = await document . getByTestId ( 'testid-text-input' )
37+ /* istanbul ignore next */
3538 expect ( await page . evaluate ( el => el . outerHTML , element ) ) . toMatchSnapshot ( )
3639 } )
3740
@@ -43,12 +46,14 @@ describe('lib/extend.ts', () => {
4346 await scope . getByTitle ( 'missing' )
4447 fail ( )
4548 } catch ( err ) {
46- expect ( err ) . toMatchSnapshot ( )
49+ err . message = err . message . replace ( / \( .* ?: \d + : \d + / g, '<stack>:X:X' )
50+ expect ( err . message ) . toMatchSnapshot ( )
4751 }
4852 } )
4953
5054 it ( 'should handle the LabelText methods' , async ( ) => {
5155 const element = await document . getByLabelText ( 'Label A' )
56+ /* istanbul ignore next */
5257 expect ( await page . evaluate ( el => el . outerHTML , element ) ) . toMatchSnapshot ( )
5358 } )
5459
@@ -68,6 +73,7 @@ describe('lib/extend.ts', () => {
6873 it ( 'should scope results to element' , async ( ) => {
6974 const scope = await document . $ ( '#scoped' )
7075 const element = await scope . queryByText ( / H e l l o / )
76+ /* istanbul ignore next */
7177 expect ( await page . evaluate ( el => el . textContent , element ) ) . toEqual ( 'Hello h3' )
7278 } )
7379
0 commit comments