* Expose an esSupertest for directly querying elasticsearch in tests * oops, fix bad capitalization
This commit is contained in:
parent
7e4a08c3bc
commit
90b6fa0189
|
@ -1,5 +1,6 @@
|
|||
import {
|
||||
SupertestProvider,
|
||||
KibanaSupertestProvider,
|
||||
ElasticsearchSupertestProvider,
|
||||
ChanceProvider,
|
||||
} from './services';
|
||||
|
||||
|
@ -14,7 +15,8 @@ export default async function ({ readConfigFile }) {
|
|||
es: commonConfig.get('services.es'),
|
||||
esArchiver: commonConfig.get('services.esArchiver'),
|
||||
retry: commonConfig.get('services.retry'),
|
||||
supertest: SupertestProvider,
|
||||
supertest: KibanaSupertestProvider,
|
||||
esSupertest: ElasticsearchSupertestProvider,
|
||||
chance: ChanceProvider,
|
||||
},
|
||||
servers: commonConfig.get('servers'),
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
export { SupertestProvider } from './supertest';
|
||||
export { KibanaSupertestProvider, ElasticsearchSupertestProvider } from './supertest';
|
||||
export { ChanceProvider } from './chance';
|
||||
|
|
|
@ -2,8 +2,14 @@ import { format as formatUrl } from 'url';
|
|||
|
||||
import supertestAsPromised from 'supertest-as-promised';
|
||||
|
||||
export function SupertestProvider({ getService }) {
|
||||
export function KibanaSupertestProvider({ getService }) {
|
||||
const config = getService('config');
|
||||
const kibanaServerUrl = formatUrl(config.get('servers.kibana'));
|
||||
return supertestAsPromised(kibanaServerUrl);
|
||||
}
|
||||
|
||||
export function ElasticsearchSupertestProvider({ getService }) {
|
||||
const config = getService('config');
|
||||
const elasticSearchServerUrl = formatUrl(config.get('servers.elasticsearch'));
|
||||
return supertestAsPromised(elasticSearchServerUrl);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue