'use strict' ; import ma = require ( 'azure-pipelines-task-lib/mock-answer' ) ; import tmrm = require ( 'azure-pipelines-task-lib/mock-run' ) ; import path = require ( 'path' ) ; import os = require ( 'os' ) ; let taskPath = path . join ( __dirname , '..' , 'app-store-release.js' ) ; let tmr = new tmrm . TaskMockRunner ( taskPath ) ; tmr . setInput ( 'authType' , 'UserAndPass' ) ; tmr . setInput ( 'username' , 'creds-username' ) ; tmr . setInput ( 'password' , 'creds-password' ) ; tmr . setInput ( 'releaseTrack' , 'TestFlight' ) ; tmr . setInput ( 'appType' , 'iOS' ) ; process . env [ 'HOME' ] = '/usr/bin' ; let a = < ma . TaskLibAnswers > { 'which' : { 'ruby' : '/usr/bin/ruby' , 'gem' : '/usr/bin/gem' , 'deliver' : '/usr/bin/deliver' , 'pilot' : '/usr/bin/pilot' } , 'checkPath' : { '/usr/bin/ruby' : true , '/usr/bin/gem' : true , '/usr/bin/deliver' : true , '/usr/bin/pilot' : true } , 'exec' : { '/usr/bin/gem install pilot' : { 'code' : 0 , 'stdout' : '10 gems installed' } , 'pilot upload -u creds-username -i <path>' : { 'code' : 0 , 'stdout' : 'consider it uploaded!' } } } ; tmr . setAnswers ( a ) ; os . platform = ( ) => { return 'darwin' ; } ; tmr . registerMock ( 'os' , os ) ; tmr . run ( ) ;