backend-test-utils: explicit return type for mockServices.config()

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-02-06 17:36:22 +01:00
parent f1adb2e36b
commit 1835311713
3 changed files with 8 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-test-utils': patch
---
Added explicit return type signature for `mockServices.config()`.
+1 -2
View File
@@ -6,7 +6,6 @@
import { Backend } from '@backstage/backend-app-api';
import { BackendFeature } from '@backstage/backend-plugin-api';
import { CacheService } from '@backstage/backend-plugin-api';
import { ConfigReader } from '@backstage/config';
import { ConfigService } from '@backstage/backend-plugin-api';
import { DatabaseService } from '@backstage/backend-plugin-api';
import { ExtendedHttpServer } from '@backstage/backend-app-api';
@@ -37,7 +36,7 @@ export namespace mockServices {
factory: () => ServiceFactory<CacheService>;
}
// (undocumented)
export function config(options?: config.Options): ConfigReader;
export function config(options?: config.Options): ConfigService;
// (undocumented)
export namespace config {
// (undocumented)
@@ -15,6 +15,7 @@
*/
import {
ConfigService,
coreServices,
createServiceFactory,
IdentityService,
@@ -56,7 +57,7 @@ function simpleFactory<TService, TOptions extends [options?: object] = []>(
* @alpha
*/
export namespace mockServices {
export function config(options?: config.Options) {
export function config(options?: config.Options): ConfigService {
return new ConfigReader(options?.data, 'mock-config');
}
export namespace config {