import path from 'path' ; import { execSync } from 'child_process' ; const ES_ARCHIVE_DIR = path . resolve ( __dirname , '../../cypress/fixtures/es_archiver' ) ; const NODE_TLS_REJECT_UNAUTHORIZED = '1' ; export const esArchiverLoad = ( archiveName ) => { const archivePath = path . join ( ES_ARCHIVE_DIR , archiveName ) ; execSync ( `node ../../../../scripts/es_archiver load "${ archivePath }" --config ../../../test/functional/config.js` , { env : { ... process . env , NODE_TLS_REJECT_UNAUTHORIZED } , stdio : 'inherit' } ) ; } ; export const esArchiverUnload = ( archiveName ) => { const archivePath = path . join ( ES_ARCHIVE_DIR , archiveName ) ; execSync ( `node ../../../../scripts/es_archiver unload "${ archivePath }" --config ../../../test/functional/config.js` , { env : { ... process . env , NODE_TLS_REJECT_UNAUTHORIZED } , stdio : 'inherit' } ) ; } ; export const esArchiverResetKibana = ( ) => { execSync ( `node ../../../../scripts/es_archiver empty-kibana-index --config ../../../test/functional/config.js` , { env : { ... process . env , NODE_TLS_REJECT_UNAUTHORIZED } , stdio : 'inherit' } ) ; } ;