mirror of
https://code.forgejo.org/actions/git-backporting.git
synced 2025-05-14 09:39:13 -04:00
feat: integrate tool with gitlab service (#39)
* feat: integrate tool with gitlab service Fix https://github.com/lampajr/backporting/issues/30
This commit is contained in:
parent
8a007941d1
commit
107f5e52d6
35 changed files with 17821 additions and 1553 deletions
34
test/service/git/git-client-factory.test.ts
Normal file
34
test/service/git/git-client-factory.test.ts
Normal file
|
@ -0,0 +1,34 @@
|
|||
import GitClientFactory from "@bp/service/git/git-client-factory";
|
||||
import { GitClientType } from "@bp/service/git/git.types";
|
||||
import GitHubClient from "@bp/service/git/github/github-client";
|
||||
import GitLabClient from "@bp/service/git/gitlab/gitlab-client";
|
||||
|
||||
describe("git client factory test", () => {
|
||||
|
||||
beforeEach(() => {
|
||||
// reset git service
|
||||
GitClientFactory.reset();
|
||||
});
|
||||
|
||||
test("correctly create github client", () => {
|
||||
const client = GitClientFactory.getOrCreate(GitClientType.GITHUB, "auth", "apiurl");
|
||||
expect(client).toBeInstanceOf(GitHubClient);
|
||||
});
|
||||
|
||||
test("correctly create gitlab client", () => {
|
||||
const client = GitClientFactory.getOrCreate(GitClientType.GITLAB, "auth", "apiurl");
|
||||
expect(client).toBeInstanceOf(GitLabClient);
|
||||
});
|
||||
|
||||
test("check get service github", () => {
|
||||
const create = GitClientFactory.getOrCreate(GitClientType.GITHUB, "auth", "apiurl");
|
||||
const get = GitClientFactory.getClient();
|
||||
expect(create).toStrictEqual(get);
|
||||
});
|
||||
|
||||
test("check get service gitlab", () => {
|
||||
const create = GitClientFactory.getOrCreate(GitClientType.GITLAB, "auth", "apiurl");
|
||||
const get = GitClientFactory.getClient();
|
||||
expect(create).toStrictEqual(get);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue