'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-promote.js' ) ; let tmr = new tmrm . TaskMockRunner ( taskPath ) ; tmr . setInput ( 'authType' , 'UserAndPass' ) ; tmr . setInput ( 'username' , 'creds-username' ) ; tmr . setInput ( 'password' , 'creds-password' ) ; tmr . setInput ( 'appIdentifier' , 'com.microsoft.test.appId' ) ; tmr . setInput ( 'chooseBuild' , 'Latest' ) ; tmr . setInput ( 'isTwoFactorAuth' , 'true' ) ; tmr . setInput ( 'appSpecificPassword' , '@PP$pecificP@$$word' ) ; tmr . setInput ( 'fastlaneSession' , 'session...' ) ; process . env [ 'MOCK_NORMALIZE_SLASHES' ] = 'true' ; process . env [ 'HOME' ] = '/usr/bin' ; let myAnswers = `{
    "which": {
        "ruby": "/usr/bin/ruby",
        "gem": "/usr/bin/gem",
        "fastlane": "/usr/bin/fastlane"
    },
    "checkPath" : {
        "/usr/bin/ruby": true,
        "/usr/bin/gem": true,
        "/usr/bin/fastlane": true
    },
    "exec": {
        "fastlane deliver submit_build -u creds-username -a com.microsoft.test.appId --skip_binary_upload true --skip_metadata true --skip_screenshots true --force": {
            "code": 0,
            "stdout": "consider it uploaded!"
        }
    }
 }` ; let json = JSON . parse ( myAnswers ) ; tmr . setAnswers ( < ma . TaskLibAnswers > json ) ; os . platform = ( ) => { return 'darwin' ; } ; tmr . registerMock ( 'os' , os ) ; tmr . run ( ) ;