aboutsummaryrefslogtreecommitdiff
path: root/test/unit/commit.unit.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/commit.unit.test.ts')
-rw-r--r--test/unit/commit.unit.test.ts40
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() => {