From 1458b430406743f902a60f5f8e2083814179a663 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Tue, 6 Dec 2022 14:30:20 +0100 Subject: [PATCH] chore: simplify catalogService tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fredrik Adelöw Signed-off-by: Johan Haals --- plugins/catalog-node/src/catalogService.test.ts | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/plugins/catalog-node/src/catalogService.test.ts b/plugins/catalog-node/src/catalogService.test.ts index 593f5bd59c..230af79a88 100644 --- a/plugins/catalog-node/src/catalogService.test.ts +++ b/plugins/catalog-node/src/catalogService.test.ts @@ -17,7 +17,6 @@ import { PluginEndpointDiscovery } from '@backstage/backend-common'; import { createBackendModule, - createServiceFactory, coreServices, } from '@backstage/backend-plugin-api'; import { startTestBackend } from '@backstage/backend-test-utils'; @@ -27,15 +26,6 @@ import { catalogServiceRef } from './catalogService'; describe('catalogServiceRef', () => { it('should return a catalogClient', async () => { expect.assertions(1); - - const mockDiscoveryFactory = createServiceFactory({ - service: coreServices.discovery, - deps: {}, - factory: async ({}) => { - return async () => jest.fn() as unknown as PluginEndpointDiscovery; - }, - }); - const testModule = createBackendModule({ moduleId: 'test', pluginId: 'test', @@ -52,7 +42,9 @@ describe('catalogServiceRef', () => { }); await startTestBackend({ - services: [mockDiscoveryFactory], + services: [ + [coreServices.discovery, {} as unknown as PluginEndpointDiscovery], + ], features: [testModule()], }); });