From 9736749a779661a95211a91200617a03a1b9a702 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 15 Aug 2021 15:03:44 +0200 Subject: Added a count query parameter to the log API endpoint --- test/unit/commit.unit.test.ts | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'test/unit/commit.unit.test.ts') diff --git a/test/unit/commit.unit.test.ts b/test/unit/commit.unit.test.ts index d302ea8..0d8c918 100644 --- a/test/unit/commit.unit.test.ts +++ b/test/unit/commit.unit.test.ts @@ -1,6 +1,6 @@ import { Repository } from "server/src/git/repository"; import { Commit } from "server/src/git/commit"; -import { EnvironmentVariables, expectCommitProperties } from "../util"; +import { EnvironmentVariables } from "../util"; import { Diff } from "server/src/git/diff"; import { Tree } from "server/src/git/tree"; @@ -15,14 +15,12 @@ describe("Commit", () => { describe("Class methods", () => { it("Should look up a commit", async() => { - expect.assertions(8); + expect.assertions(2); const commit = await Commit.lookup(repository, env.AVAIL_COMMIT); expect(commit).toBeDefined(); expect(commit).toBeInstanceOf(Commit); - - expectCommitProperties(commit); }); it("Should look up a nonexistant commit and throw", async() => { @@ -42,6 +40,20 @@ describe("Commit", () => { await expect(Commit.lookupExists(repository, env.UNAVAIL_COMMIT)).resolves.toBeFalsy(); }); + + it("Should get multiple commits", async() => { + expect.hasAssertions(); + + const commits = await Commit.getMultiple(repository); + + expect(commits).toBeDefined(); + expect(commits).toHaveLength(20); + + for(const commit of commits) { + expect(commit).toBeDefined(); + expect(commit).toBeInstanceOf(Commit); + } + }); }); describe("Instance methods", () => { -- cgit v1.2.3-18-g5258