Skip to content

Commit 8276d4a

Browse files
Kahitarstefanhaller
authored andcommitted
test: TDD - support Azure DevOps vs-ssh.visualstudio.com SSH remotes
1 parent 0c0f53f commit 8276d4a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pkg/commands/hosting_service/hosting_service_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,22 @@ func TestGetPullRequestURL(t *testing.T) {
223223
assert.Equal(t, "https://mycompany.azuredevops.com/collection/myproject/_git/myrepo/pullrequestcreate?sourceRef=feature%2Fnew", url)
224224
},
225225
},
226+
{
227+
testName: "Opens a link to new pull request on Azure DevOps (legacy vs-ssh.visualstudio.com SSH) with mapping to dev.azure.com",
228+
from: "feature/new",
229+
remoteUrl: "[email protected]:v3/myorg/myproject/myrepo",
230+
configServiceDomains: map[string]string{
231+
"vs-ssh.visualstudio.com": "azuredevops:dev.azure.com",
232+
},
233+
test: func(url string, err error) {
234+
/* EXPECTED:
235+
assert.NoError(t, err)
236+
assert.Equal(t, "https://dev.azure.com/myorg/myproject/_git/myrepo/pullrequestcreate?sourceRef=feature%2Fnew", url)
237+
ACTUAL: */
238+
assert.Error(t, err)
239+
assert.Equal(t, "", url)
240+
},
241+
},
226242
{
227243
testName: "Opens a link to new pull request on Bitbucket Server (SSH)",
228244
from: "feature/new",

0 commit comments

Comments
 (0)