import * as SUT from '../index' ; import { defaultCheckOptions } from '../index' ; import { ElementHandle } from 'playwright' ; describe ( 'check handle' , ( ) : void => { beforeEach ( ( ) : void => { } ) ; test ( 'should throw an error when the browser has not been launched' , async ( ) : Promise < void > => { const handle = undefined ; const expectedError = new Error ( "Cannot check 'foobar' because no browser has been launched" ) ; await SUT . checkHandle ( handle , 'foobar' , undefined , defaultCheckOptions ) . catch ( ( error ) : void => expect ( error ) . toMatchObject ( expectedError ) ) ; } ) ; } ) ;