Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Test } from '@nestjs/testing'
import { http, HttpResponse } from 'msw'
import { setupServer } from 'msw/node'
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it } from 'vitest'
import { mockDeep } from 'vitest-mock-extended'
import { ConfigurationService } from '../infrastructure/configuration/configuration.service'
import { NexusClientService } from './nexus-client.service'
import { NexusHttpClientService } from './nexus-http-client.service'
Expand All @@ -21,13 +22,14 @@ function createNexusServiceTestingModule() {
NexusHttpClientService,
{
provide: ConfigurationService,
useValue: {
useValue: mockDeep<ConfigurationService>({
nexusSecretExposedUrl: 'https://nexus.example',
nexusInternalUrl: nexusUrl,
nexusAdmin: 'admin',
nexusAdminPassword,
projectRootDir: 'forge',
} satisfies Partial<ConfigurationService>,
getInternalOrPublicNexusUrl: () => nexusUrl,
} satisfies Partial<ConfigurationService>),
},
],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ export class NexusHttpClientService {
}

private get baseUrl() {
if (!this.config.nexusInternalUrl) {
throw new NexusError('NotConfigured', 'NEXUS_INTERNAL_URL is required')
const url = this.config.getInternalOrPublicNexusUrl()
if (!url) {
throw new NexusError('NotConfigured', 'NEXUS_INTERNAL_URL or NEXUS_URL is required')
}
return this.config.nexusInternalUrl
return url
}

private get apiBaseUrl() {
Expand Down