aboutsummaryrefslogtreecommitdiff
path: root/test/unit/commit.unit.test.ts
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-08-11 12:59:23 +0200
committerHampusM <hampus@hampusmat.com>2021-08-11 12:59:23 +0200
commit108b469cbb09f911c9a52d4134a504d9b51ac30d (patch)
tree309763642bf53b4adecf20bfd09047715f572c39 /test/unit/commit.unit.test.ts
parent3eb8757b8db81476782870d460e3d856907186a7 (diff)
Implemented gpg signed commit support
Diffstat (limited to 'test/unit/commit.unit.test.ts')
-rw-r--r--test/unit/commit.unit.test.ts40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/unit/commit.unit.test.ts b/test/unit/commit.unit.test.ts
index 137c64c..c8cc06f 100644
--- a/test/unit/commit.unit.test.ts
+++ b/test/unit/commit.unit.test.ts
@@ -80,5 +80,45 @@ describe("Commit", () => {
expect(tree).toBeDefined();
expect(tree).toBeInstanceOf(Tree);
});
+
+ it("Should get if it's signed and respond true", async() => {
+ expect.assertions(2);
+
+ const is_signed = await commit.isSigned();
+
+ expect(is_signed).toBeDefined();
+ expect(is_signed).toBeTruthy();
+ });
+
+ it("Should get if a unsigned commit is signed and respond false", async() => {
+ expect.assertions(2);
+
+ const other_commit = await Commit.lookup(repository, "7578c24113ba71d7435a94c649566e4e39e0e88c");
+
+ const is_signed = await other_commit.isSigned();
+
+ expect(is_signed).toBeDefined();
+ expect(is_signed).toBeFalsy();
+ });
+
+ it("Should get the author", async() => {
+ expect.assertions(7);
+
+ const author = await commit.author();
+
+ expect(author).toBeDefined();
+
+ expect(author).toHaveProperty("name");
+ expect(author.name).toBeDefined();
+
+ expect(author).toHaveProperty("email");
+ expect(author.email).toBeDefined();
+
+ expect(author).toHaveProperty("fingerprint");
+
+ const fingerprint = await author.fingerprint();
+
+ expect(fingerprint).toBeDefined();
+ });
});
}); \ No newline at end of file