@@ -19,6 +19,20 @@ describe("parseChangeRequestUrl", () => {
1919 } ) ;
2020 } ) ;
2121
22+ it ( "reads a GitCafe pull request at its canonical /pull/ path and the older /pulls/ path" , ( ) => {
23+ for ( const path of [ "pull" , "pulls" ] ) {
24+ expect (
25+ parseChangeRequestUrl ( `https://git.cafe/PingDotGG/T3Code/${ path } /23897` ) ,
26+ path ,
27+ ) . toEqual ( { host : "git.cafe" , repository : "pingdotgg/t3code" , number : 23897 } ) ;
28+ }
29+ expect ( parseChangeRequestUrl ( "https://staging.git.cafe/team/repo/pull/7/files" ) ) . toEqual ( {
30+ host : "staging.git.cafe" ,
31+ repository : "team/repo" ,
32+ number : 7 ,
33+ } ) ;
34+ } ) ;
35+
2236 it ( "reads Forgejo URLs even when the hostname contains github" , ( ) => {
2337 expect ( parseChangeRequestUrl ( "https://github.internal/team/repo/pulls/7" ) ) . toEqual ( {
2438 host : "github.internal" ,
@@ -106,6 +120,9 @@ describe("parseChangeRequestUrl", () => {
106120 it ( "claims nothing it cannot be sure of" , ( ) => {
107121 for ( const link of [
108122 "https://github.com/t3tools/t3code/issues/123" ,
123+ "https://git.cafe/pingdotgg/t3code/issues/23897" ,
124+ "https://git.cafe/pingdotgg/t3code/pull/abc" ,
125+ "https://git.cafe/pingdotgg/t3code" ,
109126 "https://github.com/t3tools/t3code/commit/0a1b2c3" ,
110127 "https://github.com/t3tools/t3code" ,
111128 "https://github.com/t3tools/t3code/pull/abc" ,
0 commit comments