import { ADTClient , createSSLConfig } from "../" ; import { AdtHTTP } from "../AdtHTTP" ; export function create ( ) { if ( ! process . env . ADT_URL ) return ; return new ADTClient ( process . env . ADT_URL ! , process . env . ADT_USER ! , process . env . ADT_PASS ! , "" , "" , createSSLConfig ( ! process . env . ADT_URL ! . match ( /^http:/i ) ) ) ; } export function createHttp ( language = "" ) { if ( ! process . env . ADT_URL ) return ; return new AdtHTTP ( process . env . ADT_URL ! , process . env . ADT_USER ! , process . env . ADT_PASS ! , "" , language , createSSLConfig ( ! process . env . ADT_URL ! . match ( /^http:/i ) ) ) ; } export async function hasAbapGit ( c ) { return ! ! ( await c . featureDetails ( "abapGit Repositories" ) ) ; } export const runTest = ( f ) => { const c = create ( ) ; return async ( ) => { if ( ! c ) return ; try { await f ( c ) ; } finally { jest . setTimeout ( 5000 ) ; if ( c . statelessClone . loggedin ) c . statelessClone . logout ( ) ; if ( c . loggedin ) c . logout ( ) ; } } ; } ;