refactor: changed method name and removed useless data

This commit is contained in:
Andrea Lamparelli 2023-06-22 17:57:49 +02:00
parent 99fbcc39cc
commit a30b6d6290
8 changed files with 19 additions and 34 deletions

View file

@ -15,7 +15,7 @@ describe("pull request config parser", () => {
let parser: PullRequestConfigsParser;
beforeAll(() => {
GitServiceFactory.init(GitServiceType.GITHUB, "whatever");
GitServiceFactory.getOrCreate(GitServiceType.GITHUB, "whatever");
});
beforeEach(() => {
@ -95,8 +95,6 @@ describe("pull request config parser", () => {
cloneUrl: "https://github.com/owner/reponame.git"
},
bpBranchName: undefined,
nCommits: 0,
commits: []
});
});
@ -289,8 +287,6 @@ describe("pull request config parser", () => {
cloneUrl: "https://github.com/owner/reponame.git"
},
bpBranchName: undefined,
nCommits: 0,
commits: []
});
});
@ -365,8 +361,6 @@ describe("pull request config parser", () => {
cloneUrl: "https://github.com/owner/reponame.git"
},
bpBranchName: undefined,
nCommits: 0,
commits: []
});
});
@ -441,8 +435,6 @@ describe("pull request config parser", () => {
cloneUrl: "https://github.com/owner/reponame.git"
},
bpBranchName: undefined,
nCommits: 0,
commits: []
});
});
});

View file

@ -10,7 +10,7 @@ describe("github service", () => {
beforeAll(() => {
// init git service
GitServiceFactory.init(GitServiceType.GITHUB, "whatever");
GitServiceFactory.getOrCreate(GitServiceType.GITHUB, "whatever");
});
beforeEach(() => {
@ -33,7 +33,7 @@ describe("github service", () => {
cloneUrl: "https://github.com/owner/reponame.git"
});
expect(res.title).toBe("PR Title");
expect(res.commits.length).toBe(1);
expect(res.commits!.length).toBe(1);
expect(res.commits).toEqual(["28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc"]);
});