import { assertion , spawn , api , sleep } from '../utils' ; import { TestSuite , TestParams } from '../core' ; const testSuite = async ( { scenario , config } ) : Promise < void > => { const plugin = scenario . plugins [ 0 ] ; assertion . not . isNull ( plugin ) ; const result = await spawn ( 'twilio' , [ 'flex:plugins:release' , '--plugin' , `${ plugin . name }@${ plugin . version }` , '-l' , 'debug' , ... config . regionFlag , ] ) ; await sleep ( 1000 ) ; const release = await api . getActiveRelease ( ) ; const plugins = await api . getActivePlugins ( release ! . configuration_sid ) ; assertion . stringContains ( result . stdout , 'successful' ) ; assertion . stringContains ( result . stdout , 'Configuration FJ' ) ; assertion . stringContains ( result . stdout , 'enabled' ) ; assertion . equal ( 1 , plugins . plugins . length ) ; assertion . equal ( plugins . plugins [ 0 ] . unique_name , plugin . name ) ; assertion . equal ( plugins . plugins [ 0 ] . version , plugin . version ) ; } ; testSuite . description = 'Running {{twilio flex:plugins:release}}' ; export default testSuite ;