This repository was archived by the owner on Sep 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -215,6 +215,24 @@ describe('readPackage', () => {
215215 { virtual : true } ,
216216 )
217217
218+ const playwright = await readPackage ( )
219+ expect ( playwright ) . toStrictEqual ( { [ FIREFOX ] : FIREFOX } )
220+ } )
221+ it ( 'should return playwright-firefox when it is defined and empty dependencies are persistent' , async ( ) => {
222+ ; ( ( fs . exists as unknown ) as jest . Mock ) . mockImplementationOnce (
223+ ( _ , cb : ( exists : boolean ) => void ) => cb ( true ) ,
224+ )
225+ jest . mock (
226+ path . join ( __dirname , '..' , 'package.json' ) ,
227+ ( ) => ( {
228+ dependencies : { } ,
229+ devDependencies : {
230+ 'playwright-firefox' : '*' ,
231+ } ,
232+ } ) ,
233+ { virtual : true } ,
234+ )
235+
218236 const playwright = await readPackage ( )
219237 expect ( playwright ) . toStrictEqual ( { [ FIREFOX ] : FIREFOX } )
220238 } )
Original file line number Diff line number Diff line change @@ -27,6 +27,9 @@ export const checkDependencies = (
2727 if ( dependencies [ `playwright-${ WEBKIT } ` ] ) {
2828 packages [ WEBKIT ] = WEBKIT
2929 }
30+ if ( Object . keys ( packages ) . length === 0 ) {
31+ return null
32+ }
3033 return packages
3134}
3235
You can’t perform that action at this time.
0 commit comments