import tmrm = require ( "azure-pipelines-task-lib/mock-run" ) ; export function registerLocationHelpersMock ( tmr ) { const mockLocationUtils = { getFeedUriFromBaseServiceUri ( serviceUri , accesstoken ) { return serviceUri + "/feed" ; } , getBlobstoreUriFromBaseServiceUri ( serviceUri , accesstoken ) { return serviceUri + "/blobstore" ; } , getPackagingUris ( input ) { const collectionUrl = "https://vsts/packagesource" ; return { PackagingUris : [ collectionUrl ] , DefaultPackagingUri : collectionUrl , } ; } , getWebApiWithProxy ( serviceUri , accessToken ? ) { return { vsoClient : { async getVersioningData ( ApiVersion , PackagingAreaName , PackageAreaId , Obj ) { return { requestUrl : "foobar" } ; } , } , } ; } , getSystemAccessToken ( ) { return "token" ; } , getFeedRegistryUrl ( packagingUrl , registryType , feedId , accessToken ? ) { return packagingUrl + "/" + feedId ; } , ProtocolType : { NuGet : 1 , Npm : 2 , Maven : 3 , PyPi : 4 } , RegistryType : { npm : 1 , NuGetV2 : 2 , NuGetV3 : 3 , PyPiSimple : 4 , PyPiUpload : 5 , } , } ; tmr . registerMock ( 'packaging-common/locationUtilities' , mockLocationUtils ) ; tmr . registerMock ( "../locationUtilities" , mockLocationUtils ) ; }