backend-test-utils: review fixes

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2026-02-10 10:51:14 +01:00
parent 42abfb1b85
commit 1cedbc7d1b
10 changed files with 12 additions and 43 deletions
@@ -21,7 +21,6 @@ import {
import { InMemoryCatalogClient } from '@backstage/catalog-client/testUtils';
import { Entity } from '@backstage/catalog-model';
import { catalogServiceRef } from '@backstage/plugin-catalog-node';
// eslint-disable-next-line @backstage/no-undeclared-imports
import { createServiceMock } from '@backstage/backend-test-utils';
import { CatalogServiceMock } from './types';
+7 -6
View File
@@ -47,12 +47,13 @@ describe('gateway', () => {
},
});
const discovery = mockServices.discovery.mock();
discovery.getBaseUrl.mockImplementation(async (pluginId: string) => {
if (pluginId === 'external-plugin') {
return 'http://localhost:7778/api/external-plugin';
}
return `http://localhost:7777/api/${pluginId}`;
const discovery = mockServices.discovery.mock({
async getBaseUrl(pluginId) {
if (pluginId === 'external-plugin') {
return 'http://localhost:7778/api/external-plugin';
}
return `http://localhost:7777/api/${pluginId}`;
},
});
beforeAll(async () => {