Merge pull request #15047 from backstage/jhaals/srv-catalog-client

chore: simplify catalogService tests
This commit is contained in:
Fredrik Adelöw
2022-12-07 14:49:22 +01:00
committed by GitHub
@@ -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()],
});
});