kibana/x-pack/test_utils/get_config_schema.ts
Spencer 31ce503c0a
[xpack/encryptionKeys] use default keys when running from source (#36452)
* [xpack/encryptionKeys] use default keys when running from source

* add tests for the config schema with different contexts

* share the getConfigSchema helper

* await promises returned by expect().resolves

* tweak test naming

* use data-driven tests

* fix type error

* hide platform dependent config from snapshot
2019-05-10 11:13:06 -07:00

18 lines
511 B
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import Joi from 'joi';
export async function getConfigSchema(pluginProvider: any): Promise<Joi.Schema> {
class Plugin {
constructor(public readonly options: any) {}
}
const plugin = pluginProvider({ Plugin });
return await plugin.options.config(Joi);
}