mirror of
https://github.com/renovatebot/renovate.git
synced 2026-11-02 10:33:39 +00:00
2832648dda
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.
22 lines
766 B
TypeScript
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);
|
|
});
|
|
});
|
|
});
|