Files
renovate/lib/modules/datasource/maven/common.spec.ts
Jamie Tanna 2832648dda fix(datasource/maven): treat rate-limit errors for Maven Central mirror as Maven Central (#43432)
In 01bcd4fd43 we introduced knowledge of
the Maven Central mirror, but haven't taken it into account when looking
at rate limit errors.

To prevent this in the future, we can introduce a new helper function,
`isMavenCentral`, for other usage.
2026-05-18 15:43:33 +00:00

22 lines
766 B
TypeScript

import { isMavenCentral } from './common.ts';
describe('modules/datasource/maven/common', () => {
describe('isMavenCentralUrl', () => {
it.each([
['https://repo.maven.apache.org/maven2', true],
['http://repo.maven.apache.org/maven2', true],
['https://repo1.maven.org/maven2', true],
['http://repo1.maven.org/maven2', true],
// we currently only support host-based checks
['http://repo1.maven.org/maven200', true],
['ftp://repo1.maven.org/maven2', true],
// invalid URLs
['http://repo55.maven.apache.org/maven2', false],
['https://some-artifactory.local/maven2', false],
])('%s => %s', (url: string, expected: boolean) => {
expect(isMavenCentral(url)).toEqual(expected);
});
});
});