diff options
author | HampusM <hampus@hampusmat.com> | 2021-07-27 17:44:40 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2021-07-27 17:44:40 +0200 |
commit | 19f7523a4590fd41792d22d662bd6f5cf2bfead0 (patch) | |
tree | 2225d0a2f5731c24f4d2224c8abdf0544cf4785c /test/unit/commit.unit.test.ts | |
parent | 055a58e79fb225978d64a3c8e3e25377cc2a5ece (diff) |
Made the unit test structure more consistent
Diffstat (limited to 'test/unit/commit.unit.test.ts')
-rw-r--r-- | test/unit/commit.unit.test.ts | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/test/unit/commit.unit.test.ts b/test/unit/commit.unit.test.ts index 2a43855..abbdb9a 100644 --- a/test/unit/commit.unit.test.ts +++ b/test/unit/commit.unit.test.ts @@ -13,36 +13,38 @@ describe("Commit", () => { repository = await Repository.open(env.BASE_DIR, env.AVAIL_REPO); }); - it("Should look up a commit", async() => { - expect.assertions(8); + describe("Class methods", () => { + it("Should look up a commit", async() => { + expect.assertions(8); - const commit = await Commit.lookup(repository, env.AVAIL_COMMIT); + const commit = await Commit.lookup(repository, env.AVAIL_COMMIT); - expect(commit).toBeDefined(); - expect(commit).toBeInstanceOf(Commit); + expect(commit).toBeDefined(); + expect(commit).toBeInstanceOf(Commit); - expectCommitProperties(commit); - }); + expectCommitProperties(commit); + }); - it("Should look up a nonexistant commit and throw", async() => { - expect.assertions(1); + it("Should look up a nonexistant commit and throw", async() => { + expect.assertions(1); - await expect(Commit.lookup(repository, env.UNAVAIL_COMMIT)).rejects.toThrow(); - }); + await expect(Commit.lookup(repository, env.UNAVAIL_COMMIT)).rejects.toThrow(); + }); - it("Should look up if an existent commit exists and respond true", async() => { - expect.assertions(1); + it("Should look up if an existent commit exists and respond true", async() => { + expect.assertions(1); - await expect(Commit.lookupExists(repository, env.AVAIL_COMMIT)).resolves.toBeTruthy(); - }); + await expect(Commit.lookupExists(repository, env.AVAIL_COMMIT)).resolves.toBeTruthy(); + }); - it("Should look up if an nonexistant commit exists and respond false", async() => { - expect.assertions(1); + it("Should look up if an nonexistant commit exists and respond false", async() => { + expect.assertions(1); - await expect(Commit.lookupExists(repository, env.UNAVAIL_COMMIT)).resolves.toBeFalsy(); + await expect(Commit.lookupExists(repository, env.UNAVAIL_COMMIT)).resolves.toBeFalsy(); + }); }); - describe("Methods", () => { + describe("Instance methods", () => { let commit: Commit; beforeAll(async() => { |