techdocs: fix tests by reusing the instantiated discovery

This commit is contained in:
Himanshu Mishra
2021-01-24 13:01:11 +01:00
parent e44925723e
commit 38469b66bf
2 changed files with 3 additions and 9 deletions
@@ -23,7 +23,6 @@ import { Entity, EntityName } from '@backstage/catalog-model';
import {
resolvePackagePath,
PluginEndpointDiscovery,
SingleHostDiscovery,
} from '@backstage/backend-common';
import { Config } from '@backstage/config';
import {
@@ -143,10 +142,9 @@ export class LocalPublish implements PublisherBase {
}
async getStorageUrl() {
const discoveryApi = SingleHostDiscovery.fromConfig(this.config);
return (
this.config.getOptionalString('techdocs.storageUrl') ??
(await discoveryApi.getBaseUrl('techdocs'))
(await this.discovery.getBaseUrl('techdocs'))
);
}