reuse discoveryServiceRef

Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
Johan Haals
2022-08-25 13:51:21 +02:00
parent cad2b01423
commit 79373358f2
@@ -18,7 +18,7 @@ import { PluginEndpointDiscovery } from '@backstage/backend-common';
import {
createBackendModule,
createServiceFactory,
createServiceRef,
discoveryServiceRef,
} from '@backstage/backend-plugin-api';
import { startTestBackend } from '@backstage/backend-test-utils';
import { CatalogClient } from '@backstage/catalog-client';
@@ -27,9 +27,7 @@ import { catalogServiceRef } from './catalogService';
describe('catalogServiceRef', () => {
it('should return a catalogClient', async () => {
const mockDiscoveryFactory = createServiceFactory({
service: createServiceRef<PluginEndpointDiscovery>({
id: 'core.discovery',
}),
service: discoveryServiceRef,
deps: {},
factory: async ({}) => {
return async () => jest.fn() as unknown as PluginEndpointDiscovery;