mirror of
https://code.forgejo.org/actions/git-backporting.git
synced 2025-05-13 17:19:13 -04:00
fix(issue-52): use pull request github api url as source (#53)
fix https://github.com/kiegroup/git-backporting/issues/52
This commit is contained in:
parent
fcc01673f4
commit
a737aa7c4c
9 changed files with 231 additions and 5 deletions
|
@ -24,14 +24,22 @@ describe("check git utilities", () => {
|
|||
});
|
||||
|
||||
test("check infer github client", ()=> {
|
||||
expect(inferGitClient("https://github.com/superuser/backporting-example/-/merge_requests/4")).toStrictEqual(GitClientType.GITHUB);
|
||||
expect(inferGitClient("https://github.com/superuser/backporting-example/pull/4")).toStrictEqual(GitClientType.GITHUB);
|
||||
});
|
||||
|
||||
test("check infer gitlab client", ()=> {
|
||||
expect(inferGitClient("https://my.gitlab.awesome.com/superuser/backporting-example/-/merge_requests/4")).toStrictEqual(GitClientType.GITLAB);
|
||||
});
|
||||
|
||||
test("Not recognized git client type", ()=> {
|
||||
test("not recognized git client type", ()=> {
|
||||
expect(() => inferGitClient("https://not.recognized/superuser/backporting-example/-/merge_requests/4")).toThrowError("Remote git service not recognized from pr url: https://not.recognized/superuser/backporting-example/-/merge_requests/4");
|
||||
});
|
||||
|
||||
test("check infer github client using github api", ()=> {
|
||||
expect(inferGitClient("https://api.github.com/repos/owner/repo/pulls/1")).toStrictEqual(GitClientType.GITHUB);
|
||||
});
|
||||
|
||||
test("check infer github api from github api url", ()=> {
|
||||
expect(inferGitApiUrl("https://api.github.com/repos/owner/repo/pulls/1")).toStrictEqual("https://api.github.com");
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue