import * as SUT from '../index' ; import { Page } from 'playwright' ; describe ( 'get-focused-handle' , ( ) : void => { beforeEach ( ( ) : void => { } ) ; test ( 'should return an error when browser has not been launched' , async ( ) : Promise < void > => { const page = undefined ; const expectedError = new Error ( 'Cannot get focused handle because no browser has been launched' ) ; await SUT . getFocusedHandle ( page ) . catch ( ( error ) : void => expect ( error ) . toMatchObject ( expectedError ) ) ; } ) ; } ) ;