From 17c20d77600407209908de5541415f2c4a85f5e3 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 7 Aug 2021 19:16:01 +0200 Subject: Implemented tree entry commit history --- test/unit/tree_entry.unit.test.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'test/unit/tree_entry.unit.test.ts') 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); + } + }); }); }); -- cgit v1.2.3-18-g5258