Skip to content

Commit

Permalink
test(git): update test case for getDiffDetails function
Browse files Browse the repository at this point in the history
  • Loading branch information
kittisakLS committed Oct 26, 2023
1 parent b3c0fb0 commit 69c6425
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/git-services.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,16 @@ describe("Git recursively method", () => {
);
let received: any = null;
if (currentHash) {
received = gitService.getDiffDetails(currentHash);
const existParents = gitService.executeCommand(
`git rev-parse ${currentHash}^@`
);
if (existParents) {
received = gitService.getDiffDetails(currentHash);
expect(typeof received).toBe("string");
} else {
expect(received).toBe(null);
}
}
expect(typeof received).toBe("string");
});

it("should be a string", async () => {
Expand Down

0 comments on commit 69c6425

Please sign in to comment.