backend-test-utils: tweak mockConfigFactory options

Co-authored-by: Fredrik Adelöw <freben@gmail.com>
Co-authored-by: blam <ben@blam.sh>
Co-authored-by: Johan Haals <johan.haals@gmail.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-01-10 15:17:05 +01:00
committed by blam
parent 51b7a7ed07
commit ac993deb18
3 changed files with 6 additions and 3 deletions
+1
View File
@@ -39,6 +39,7 @@
"@backstage/backend-plugin-api": "workspace:^",
"@backstage/cli": "workspace:^",
"@backstage/config": "workspace:^",
"@backstage/types": "workspace:^",
"better-sqlite3": "^8.0.0",
"express": "^4.17.1",
"express-promise-router": "^4.1.0",
@@ -18,13 +18,14 @@ import {
coreServices,
createServiceFactory,
} from '@backstage/backend-plugin-api';
import { AppConfig, ConfigReader } from '@backstage/config';
import { ConfigReader } from '@backstage/config';
import { JsonObject } from '@backstage/types';
/** @public */
export const mockConfigFactory = createServiceFactory({
service: coreServices.config,
deps: {},
async factory(_, options?: { config?: AppConfig }) {
return new ConfigReader(options?.config);
async factory(_, options?: { data?: JsonObject }) {
return new ConfigReader(options?.data, 'mock-config');
},
});
+1
View File
@@ -3558,6 +3558,7 @@ __metadata:
"@backstage/backend-plugin-api": "workspace:^"
"@backstage/cli": "workspace:^"
"@backstage/config": "workspace:^"
"@backstage/types": "workspace:^"
"@types/supertest": ^2.0.8
better-sqlite3: ^8.0.0
express: ^4.17.1