@@ -40,7 +40,7 @@ suite("Github", async () => {
4040 "git@github.com:recipeyak/recipeyak" ,
4141 "org-XYZ123@github.com:recipeyak/recipeyak" ,
4242 ] ) {
43- const findRemote = async ( hostname : string ) => {
43+ async function findRemote ( hostname : string ) {
4444 return url
4545 }
4646 const gh = new Github ( { } , "origin" , findRemote )
@@ -75,7 +75,7 @@ suite("Github", async () => {
7575 "org-XYZ123@github.mycompany.com:recipeyak/recipeyak" ,
7676 "ssh://git@github.mycompany.com/recipeyak/recipeyak.git" ,
7777 ] ) {
78- const findRemote = async ( hostname : string ) => {
78+ async function findRemote ( hostname : string ) {
7979 return url
8080 }
8181 const gh = new Github (
@@ -116,7 +116,7 @@ suite("Github", async () => {
116116 "org-XYZ123@github.mycompany.com:recipeyak/recipeyak" ,
117117 "ssh://git@github.mycompany.com/recipeyak/recipeyak.git" ,
118118 ] ) {
119- const findRemote = async ( hostname : string ) => {
119+ async function findRemote ( hostname : string ) {
120120 return url
121121 }
122122 const gh = new Github (
@@ -150,47 +150,6 @@ suite("Github", async () => {
150150 assert . deepEqual ( result , expected )
151151 }
152152 } )
153- test ( "if we have no selection on the first line, don't select anything" , async ( ) => {
154- for ( let url of [
155- "git@github.mycompany.com:recipeyak/recipeyak.git" ,
156- "git@github.mycompany.com:recipeyak/recipeyak" ,
157- "org-XYZ123@github.mycompany.com:recipeyak/recipeyak" ,
158- "ssh://git@github.mycompany.com/recipeyak/recipeyak.git" ,
159- ] ) {
160- const findRemote = async ( hostname : string ) => {
161- return url
162- }
163- const gh = new Github (
164- {
165- github : { hostnames : [ "github.mycompany.com" ] } ,
166- } ,
167- "origin" ,
168- findRemote ,
169- )
170- const result = await gh . getUrls ( {
171- selection : {
172- start : { line : 0 , character : 0 } ,
173- end : { line : 0 , character : 0 } ,
174- } ,
175- head : createBranch ( "master" ) ,
176- relativeFilePath : "frontend/src/components/App.tsx" ,
177- } )
178- const expected = {
179- blobUrl :
180- "https://github.mycompany.com/recipeyak/recipeyak/blob/master/frontend/src/components/App.tsx" ,
181- blameUrl :
182- "https://github.mycompany.com/recipeyak/recipeyak/blame/master/frontend/src/components/App.tsx" ,
183- compareUrl :
184- "https://github.mycompany.com/recipeyak/recipeyak/compare/master" ,
185- historyUrl :
186- "https://github.mycompany.com/recipeyak/recipeyak/commits/master/frontend/src/components/App.tsx" ,
187- prUrl :
188- "https://github.mycompany.com/recipeyak/recipeyak/pull/new/master" ,
189- repoUrl : "https://github.mycompany.com/recipeyak/recipeyak" ,
190- }
191- assert . deepEqual ( result , expected )
192- }
193- } )
194153} )
195154
196155suite ( "Gitlab" , async ( ) => {
0 commit comments