diff options
author | HampusM <hampus@hampusmat.com> | 2021-08-07 19:16:01 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2021-08-07 19:16:01 +0200 |
commit | 17c20d77600407209908de5541415f2c4a85f5e3 (patch) | |
tree | d318292028004251b14f9fb87fa1a85838da906d /test | |
parent | b2152da8f4bea1a655f7c9c7c07b24c041173f0a (diff) |
Implemented tree entry commit history
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/tree_entry.unit.test.ts | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/unit/tree_entry.unit.test.ts b/test/unit/tree_entry.unit.test.ts index 570ba0f..de270c5 100644 --- a/test/unit/tree_entry.unit.test.ts +++ b/test/unit/tree_entry.unit.test.ts @@ -26,6 +26,34 @@ describe("Tree entry", () => { expect(latest_commit).toBeDefined(); expect(latest_commit).toBeInstanceOf(Commit); }); + + it("Should get whole commit history", async() => { + expect.hasAssertions(); + + const history = await tree_entry.history(); + + expect(history).toBeDefined(); + expect(history.length).toBeGreaterThanOrEqual(1); + + for(const hist_entry of history) { + expect(hist_entry).toBeDefined(); + expect(hist_entry).toBeInstanceOf(Commit); + } + }); + + it("Should get 5 entries of the commit history", async() => { + expect.hasAssertions(); + + const history = await tree_entry.history(5); + + expect(history).toBeDefined(); + expect(history).toHaveLength(5); + + for(const hist_entry of history) { + expect(hist_entry).toBeDefined(); + expect(hist_entry).toBeInstanceOf(Commit); + } + }); }); }); |