import { testing , PartialApplicationConfig } from 'lisk-framework' ; import { FaucetPlugin } from '../../src' ; describe ( 'faucet plugin' , ( ) => { let appEnv ; beforeAll ( async ( ) => { const rootPath = '~/.lisk/faucet-plugin' ; const config = { rootPath , label : 'faucet_functional' , plugins : { faucet : { encryptedPassphrase : 'iterations=12&cipherText=1f06671e13c0329aee057fee995e08a516bdacd287c7ff2714a74be6099713c87bbc3e005c63d4d3d02f8ba89b42810a5854444ad2b76855007a0925fafa7d870875beb010&iv=3a583b21bbac609c7df3e7e0&salt=245c6859a96339a7735a6cac78ccf625&tag=63653f1d4e8d422a42d98b25d3844792&version=1' , captchaSecretkey : '6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe' , captchaSitekey : '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI' , } , } , } as PartialApplicationConfig ; appEnv = testing . createDefaultApplicationEnv ( { config , plugins : [ FaucetPlugin ] , } ) ; await appEnv . startApplication ( ) ; } ) ; afterAll ( async ( ) => { jest . spyOn ( process , 'exit' ) . mockImplementation ( ( ( ) => { } ) as never ) ; await appEnv . stopApplication ( ) ; } ) ; it ( 'should enable faucet' , async ( ) => { const authorizeResult = await appEnv . ipcClient . invoke < { result : string ; } > ( 'faucet:authorize' , { enable : true , password : 'myTotal53cr3t%&' , } ) ; expect ( authorizeResult . result ) . toBe ( 'Successfully enabled the faucet.' ) ; } ) ; } ) ;