File tree Expand file tree Collapse file tree 1 file changed +29
-25
lines changed
Expand file tree Collapse file tree 1 file changed +29
-25
lines changed Original file line number Diff line number Diff line change @@ -1289,34 +1289,38 @@ describe('Converter', () => {
12891289 timeout
12901290 )
12911291
1292- it ( 'throws an error if setViewport fails with other error' , async ( ) => {
1293- await using browserManager = new BrowserManager ( {
1294- finders : [ 'firefox' ] ,
1295- timeout,
1296- } )
1292+ it (
1293+ 'throws an error if setViewport fails with other error' ,
1294+ async ( ) => {
1295+ await using browserManager = new BrowserManager ( {
1296+ finders : [ 'firefox' ] ,
1297+ timeout,
1298+ } )
12971299
1298- const browser = await browserManager . browserForConversion ( )
1299- const originalWithPage = browser . withPage . bind ( browser )
1300+ const browser = await browserManager . browserForConversion ( )
1301+ const originalWithPage = browser . withPage . bind ( browser )
13001302
1301- jest . spyOn ( browser , 'withPage' ) . mockImplementationOnce (
1302- async ( fn ) =>
1303- await originalWithPage ( async ( page ) => {
1304- page . setViewport = async ( ) => {
1305- throw new Error ( 'Unexpected error' )
1306- }
1307- return await fn ( page )
1308- } )
1309- )
1303+ jest . spyOn ( browser , 'withPage' ) . mockImplementationOnce (
1304+ async ( fn ) =>
1305+ await originalWithPage ( async ( page ) => {
1306+ page . setViewport = async ( ) => {
1307+ throw new Error ( 'Unexpected error' )
1308+ }
1309+ return await fn ( page )
1310+ } )
1311+ )
13101312
1311- await expect (
1312- instance ( {
1313- browserManager,
1314- output : 'a.png' ,
1315- type : ConvertType . png ,
1316- imageScale : 0.5 ,
1317- } ) . convertFile ( new File ( onePath ) )
1318- ) . rejects . toThrow ( 'Unexpected error' )
1319- } )
1313+ await expect (
1314+ instance ( {
1315+ browserManager,
1316+ output : 'a.png' ,
1317+ type : ConvertType . png ,
1318+ imageScale : 0.5 ,
1319+ } ) . convertFile ( new File ( onePath ) )
1320+ ) . rejects . toThrow ( 'Unexpected error' )
1321+ } ,
1322+ timeout
1323+ )
13201324 } )
13211325 } )
13221326 } )
You can’t perform that action at this time.
0 commit comments