backend-test-utils: renamed mockServices.config to .rootConfig
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -36,19 +36,6 @@ export namespace mockServices {
|
||||
factory: () => ServiceFactory<CacheService, 'plugin'>;
|
||||
}
|
||||
// (undocumented)
|
||||
export function config(options?: config.Options): RootConfigService;
|
||||
// (undocumented)
|
||||
export namespace config {
|
||||
// (undocumented)
|
||||
export type Options = {
|
||||
data?: JsonObject;
|
||||
};
|
||||
const // (undocumented)
|
||||
factory: (
|
||||
options?: Options | undefined,
|
||||
) => ServiceFactory<RootConfigService, 'root'>;
|
||||
}
|
||||
// (undocumented)
|
||||
export namespace database {
|
||||
const // (undocumented)
|
||||
factory: () => ServiceFactory<DatabaseService, 'plugin'>;
|
||||
@@ -83,6 +70,19 @@ export namespace mockServices {
|
||||
factory: () => ServiceFactory<PermissionsService, 'plugin'>;
|
||||
}
|
||||
// (undocumented)
|
||||
export function rootConfig(options?: rootConfig.Options): RootConfigService;
|
||||
// (undocumented)
|
||||
export namespace rootConfig {
|
||||
// (undocumented)
|
||||
export type Options = {
|
||||
data?: JsonObject;
|
||||
};
|
||||
const // (undocumented)
|
||||
factory: (
|
||||
options?: Options | undefined,
|
||||
) => ServiceFactory<RootConfigService, 'root'>;
|
||||
}
|
||||
// (undocumented)
|
||||
export namespace rootLifecycle {
|
||||
const // (undocumented)
|
||||
factory: () => ServiceFactory<RootLifecycleService, 'root'>;
|
||||
|
||||
@@ -61,13 +61,13 @@ function simpleFactory<
|
||||
* @public
|
||||
*/
|
||||
export namespace mockServices {
|
||||
export function config(options?: config.Options): RootConfigService {
|
||||
export function rootConfig(options?: rootConfig.Options): RootConfigService {
|
||||
return new ConfigReader(options?.data, 'mock-config');
|
||||
}
|
||||
export namespace config {
|
||||
export namespace rootConfig {
|
||||
export type Options = { data?: JsonObject };
|
||||
|
||||
export const factory = simpleFactory(coreServices.rootConfig, config);
|
||||
export const factory = simpleFactory(coreServices.rootConfig, rootConfig);
|
||||
}
|
||||
|
||||
export function rootLogger(options?: rootLogger.Options): LoggerService {
|
||||
|
||||
@@ -73,7 +73,7 @@ export interface TestBackend extends Backend {
|
||||
|
||||
const defaultServiceFactories = [
|
||||
mockServices.cache.factory(),
|
||||
mockServices.config.factory(),
|
||||
mockServices.rootConfig.factory(),
|
||||
mockServices.database.factory(),
|
||||
mockServices.httpRouter.factory(),
|
||||
mockServices.identity.factory(),
|
||||
|
||||
Reference in New Issue
Block a user