@@ -70,26 +70,28 @@ describe("canonicalOwnerUrl", () => {
7070 // two are compared with `===`, so every form here MUST reduce identically —
7171 // including the ssh://, git://, and port forms the old regex version threw on.
7272 it . each ( [
73- "git@github.com:Acme /Widgets.git" , // scp-like SSH
74- "https://github.com/acme /widgets" , // https
75- "https://github.com/ACME /widgets.git" , // .git suffix
76- "https://www.github.com/acme /widgets/" , // www. + trailing slash
77- "git@github.com:acme /widgets" , // scp-like, no .git
78- "ssh://git@github.com/acme /widgets.git" , // ssh:// URL form
79- "git://github.com/acme /widgets.git" , // git:// URL form
80- "https://github.com:443/acme /widgets" , // explicit port
81- "https://x-access-token@GitHub.com/Acme /Widgets" , // userinfo + mixed case
82- "acme " , // bare owner login (the form the server canonicalizes)
73+ "git@github.com:__Taskless_Test__ /Widgets.git" , // scp-like SSH
74+ "https://github.com/__taskless_test__ /widgets" , // https
75+ "https://github.com/__TASKLESS_TEST__ /widgets.git" , // .git suffix
76+ "https://www.github.com/__taskless_test__ /widgets/" , // www. + trailing slash
77+ "git@github.com:__taskless_test__ /widgets" , // scp-like, no .git
78+ "ssh://git@github.com/__taskless_test__ /widgets.git" , // ssh:// URL form
79+ "git://github.com/__taskless_test__ /widgets.git" , // git:// URL form
80+ "https://github.com:443/__taskless_test__ /widgets" , // explicit port
81+ "https://x-access-token@GitHub.com/__Taskless_Test__ /Widgets" , // userinfo + mixed case
82+ "__taskless_test__ " , // bare owner login (the form the server canonicalizes)
8383 ] ) ( "reduces %s to the canonical owner url" , ( input ) => {
84- expect ( canonicalOwnerUrl ( input ) ) . toBe ( "https://github.com/acme" ) ;
84+ expect ( canonicalOwnerUrl ( input ) ) . toBe (
85+ "https://github.com/__taskless_test__"
86+ ) ;
8587 } ) ;
8688
8789 it ( "keeps the host for non-GitHub remotes (dropped later by listRemoteOwnerUrls)" , ( ) => {
8890 // Mirrors the server: host-agnostic and never throws. A gitlab owner url
8991 // just won't match a github-sourced org.
90- expect ( canonicalOwnerUrl ( "git@gitlab.com:acme/widgets.git" ) ) . toBe (
91- "https:// gitlab.com/acme"
92- ) ;
92+ expect (
93+ canonicalOwnerUrl ( "git@ gitlab.com:__taskless_test__/widgets.git" )
94+ ) . toBe ( "https://gitlab.com/__taskless_test__" ) ;
9395 } ) ;
9496} ) ;
9597
@@ -111,7 +113,12 @@ describe("listRemoteOwnerUrls", () => {
111113 ) ;
112114 await execFileAsync (
113115 "git" ,
114- [ "remote" , "add" , "upstream" , "https://github.com/acme/widgets.git" ] ,
116+ [
117+ "remote" ,
118+ "add" ,
119+ "upstream" ,
120+ "https://github.com/__taskless_test__/widgets.git" ,
121+ ] ,
115122 { cwd : directory }
116123 ) ;
117124 await execFileAsync (
@@ -121,7 +128,7 @@ describe("listRemoteOwnerUrls", () => {
121128 ) ;
122129 expect ( await listRemoteOwnerUrls ( directory ) ) . toEqual ( [
123130 "https://github.com/origin-org" ,
124- "https://github.com/acme " ,
131+ "https://github.com/__taskless_test__ " ,
125132 "https://github.com/me" ,
126133 ] ) ;
127134 } ) ;
@@ -130,7 +137,12 @@ describe("listRemoteOwnerUrls", () => {
130137 expect ( await listRemoteOwnerUrls ( directory ) ) . toEqual ( [ ] ) ;
131138 await execFileAsync (
132139 "git" ,
133- [ "remote" , "add" , "origin" , "git@gitlab.com:acme/widgets.git" ] ,
140+ [
141+ "remote" ,
142+ "add" ,
143+ "origin" ,
144+ "git@gitlab.com:__taskless_test__/widgets.git" ,
145+ ] ,
134146 { cwd : directory }
135147 ) ;
136148 expect ( await listRemoteOwnerUrls ( directory ) ) . toEqual ( [ ] ) ;
@@ -166,11 +178,16 @@ describe("listRemoteOwnerUrls", () => {
166178 // this repo would have resolved to no current-org context.
167179 await execFileAsync (
168180 "git" ,
169- [ "remote" , "add" , "origin" , "ssh://git@github.com/Acme/Widgets.git" ] ,
181+ [
182+ "remote" ,
183+ "add" ,
184+ "origin" ,
185+ "ssh://git@github.com/__Taskless_Test__/Widgets.git" ,
186+ ] ,
170187 { cwd : directory }
171188 ) ;
172189 expect ( await listRemoteOwnerUrls ( directory ) ) . toEqual ( [
173- "https://github.com/acme " ,
190+ "https://github.com/__taskless_test__ " ,
174191 ] ) ;
175192 } ) ;
176193} ) ;
0 commit comments