import expect from '@kbn/expect' ; import { IRuleDataClient } from '../../../../../plugins/rule_registry/server' ; import { GetService } from '../../types' ; export const cleanupRegistryIndices = async ( getService , client ) => { const es = getService ( 'es' ) ; const aliasMap = await es . indices . get ( { index : `${ client . indexName }*` , allow_no_indices : true , expand_wildcards : 'open' , } ) ; const indices = Object . keys ( aliasMap ) ; expect ( indices . length > 0 ) . to . be ( true ) ; return es . indices . delete ( { index : indices } , { ignore : [ 404 ] } ) ; } ;