mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-26 07:20:39 +00:00
a53aaf4141
* refactor(java-version): extract adoptium HTTP logic from datasource class Move getPageReleases and the Adoptium fetch logic out of the JavaVersionDatasource class into a standalone adoptium.ts module. This makes the code easier to test in isolation and decouples Adoptium-specific logic from the datasource class. No behavior change — customRegistrySupport remains false, and the hardcoded adoptiumRegistryUrl replaces the previously injected defaultRegistryUrl (which was always the same value). * fix(java-version): remove unused adoptiumRegistryUrl import from test * test(java-version): use partial helper in spec * refactor(java-version): extract adoptium HTTP logic from datasource class * fix(java-version): pass Adoptium schema to HTTP client * test(java-version): move Adoptium test to module spec * chore(ci): retrigger failed checks
20 lines
557 B
TypeScript
20 lines
557 B
TypeScript
import { partial } from '~test/util.ts';
|
|
import type { Http } from '../../../util/http/index.ts';
|
|
import { getAdoptiumReleases } from './adoptium.ts';
|
|
|
|
describe('modules/datasource/java-version/adoptium', () => {
|
|
it('re-throws non-HttpError', async () => {
|
|
const mockHttp = partial<Http>({
|
|
getJson: vi.fn().mockRejectedValue(new Error('unexpected')),
|
|
});
|
|
|
|
await expect(
|
|
getAdoptiumReleases(mockHttp, {
|
|
imageType: 'jdk',
|
|
architecture: null,
|
|
os: null,
|
|
}),
|
|
).rejects.toThrow('unexpected');
|
|
});
|
|
});
|