import { Context } from 'mocha' ; import { ToolingLog } from '@kbn/dev-utils' ; import { FtrProviderContext } from '../api_integration/ftr_provider_context' ; export function warnAndSkipTest ( mochaContext , log ) { log . warning ( 'disabling tests because DockerServers service is not enabled, set FLEET_PACKAGE_REGISTRY_PORT to run them' ) ; mochaContext . skip ( ) ; } export function skipIfNoDockerRegistry ( providerContext ) { const { getService } = providerContext ; const dockerServers = getService ( 'dockerServers' ) ; const server = dockerServers . get ( 'registry' ) ; const log = getService ( 'log' ) ; beforeEach ( function beforeSetupWithDockerRegistry ( ) { if ( ! server . enabled ) { warnAndSkipTest ( this , log ) ; } } ) ; }