@@ -148,6 +148,22 @@ describe('resolveRegistryBaseUrl', () => {
148148 'https://repo.jenkins-ci.org/public' ,
149149 )
150150 } )
151+
152+ it ( 'returns JitPack for io.github namespace' , ( ) => {
153+ expect ( resolveRegistryBaseUrl ( 'io.github.resilience4j' ) ) . toBe ( 'https://jitpack.io' )
154+ } )
155+
156+ it ( 'returns JitPack for bare io.github (exact match)' , ( ) => {
157+ expect ( resolveRegistryBaseUrl ( 'io.github' ) ) . toBe ( 'https://jitpack.io' )
158+ } )
159+
160+ it ( 'returns JitPack for com.github namespace' , ( ) => {
161+ expect ( resolveRegistryBaseUrl ( 'com.github.ben-manes' ) ) . toBe ( 'https://jitpack.io' )
162+ } )
163+
164+ it ( 'does not match io.githubfoo — prefix boundary must end at a dot' , ( ) => {
165+ expect ( resolveRegistryBaseUrl ( 'io.githubfoo' ) ) . toBe ( MAVEN_CENTRAL_BASE_URL )
166+ } )
151167} )
152168
153169describe ( 'resolveRegistryPageUrl' , ( ) => {
@@ -174,6 +190,22 @@ describe('resolveRegistryPageUrl', () => {
174190 'https://central.sonatype.com/artifact/org.apache.commons/commons-lang3' ,
175191 )
176192 } )
193+
194+ it ( 'returns JitPack browse URL for io.github' , ( ) => {
195+ expect ( resolveRegistryPageUrl ( 'io.github.resilience4j' , 'resilience4j-core' ) ) . toBe (
196+ 'https://jitpack.io/#resilience4j/resilience4j-core' ,
197+ )
198+ } )
199+
200+ it ( 'returns JitPack browse URL for com.github' , ( ) => {
201+ expect ( resolveRegistryPageUrl ( 'com.github.ben-manes' , 'caffeine' ) ) . toBe (
202+ 'https://jitpack.io/#ben-manes/caffeine' ,
203+ )
204+ } )
205+
206+ it ( 'returns JitPack browse URL for bare io.github prefix without leaking the prefix into the path' , ( ) => {
207+ expect ( resolveRegistryPageUrl ( 'io.github' , 'some-lib' ) ) . toBe ( 'https://jitpack.io/#/some-lib' )
208+ } )
177209} )
178210
179211describe ( 'resolveRegistryPageUrlFromBase' , ( ) => {
0 commit comments