fix test cases
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
This commit is contained in:
@@ -33,6 +33,9 @@ const baseFactories = [
|
||||
mockServices.lifecycle.factory(),
|
||||
mockServices.rootLogger.factory(),
|
||||
mockServices.logger.factory(),
|
||||
mockServices.rootConfig.factory(),
|
||||
mockServices.rootHttpRouter.mock().factory,
|
||||
mockServices.rootHealth.factory(),
|
||||
];
|
||||
|
||||
function mkNoopFactory(ref: ServiceRef<{}, 'plugin'>) {
|
||||
@@ -808,7 +811,7 @@ describe('BackendInitializer', () => {
|
||||
});
|
||||
|
||||
it('should forward errors when modules fail to start', async () => {
|
||||
const init = new BackendInitializer([]);
|
||||
const init = new BackendInitializer(baseFactories);
|
||||
init.add(testPlugin);
|
||||
init.add(
|
||||
createBackendModule({
|
||||
@@ -830,7 +833,7 @@ describe('BackendInitializer', () => {
|
||||
});
|
||||
|
||||
it('should reject duplicate plugins', async () => {
|
||||
const init = new BackendInitializer([]);
|
||||
const init = new BackendInitializer(baseFactories);
|
||||
init.add(
|
||||
createBackendPlugin({
|
||||
pluginId: 'test',
|
||||
@@ -859,7 +862,7 @@ describe('BackendInitializer', () => {
|
||||
});
|
||||
|
||||
it('should reject duplicate modules', async () => {
|
||||
const init = new BackendInitializer([]);
|
||||
const init = new BackendInitializer(baseFactories);
|
||||
init.add(testPlugin);
|
||||
init.add(
|
||||
createBackendModule({
|
||||
@@ -896,6 +899,9 @@ describe('BackendInitializer', () => {
|
||||
const init = new BackendInitializer([
|
||||
mockServices.rootLifecycle.factory(),
|
||||
mockServices.rootLogger.factory(),
|
||||
mockServices.rootHttpRouter.mock().factory,
|
||||
mockServices.rootHealth.factory(),
|
||||
mockServices.rootConfig.factory(),
|
||||
]);
|
||||
init.add(testPlugin);
|
||||
init.add(
|
||||
|
||||
@@ -39,7 +39,10 @@ import { ConfigSources } from '@backstage/config-loader';
|
||||
import { Logs, MockedLogger, LogContent } from '../__testUtils__/testUtils';
|
||||
import { PluginScanner } from '../scanner/plugin-scanner';
|
||||
import { findPaths } from '@backstage/cli-common';
|
||||
import { createMockDirectory } from '@backstage/backend-test-utils';
|
||||
import {
|
||||
createMockDirectory,
|
||||
mockServices,
|
||||
} from '@backstage/backend-test-utils';
|
||||
import { rootLifecycleServiceFactory } from '@backstage/backend-defaults/rootLifecycle';
|
||||
import { BackstagePackageJson, PackageRole } from '@backstage/cli-node';
|
||||
|
||||
@@ -997,6 +1000,8 @@ describe('backend-dynamic-feature-service', () => {
|
||||
|
||||
const backend = createSpecializedBackend({
|
||||
defaultServiceFactories: [
|
||||
mockServices.rootHealth.factory(),
|
||||
mockServices.rootHttpRouter.mock().factory,
|
||||
rootLifecycleServiceFactory,
|
||||
createServiceFactory({
|
||||
service: coreServices.rootConfig,
|
||||
|
||||
Reference in New Issue
Block a user