From 64fe51d449785c5f443c9adac20df274cd6a2284 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 22 Jul 2021 12:17:14 +0200 Subject: Improved test names --- test/unit/commit.unit.test.ts | 14 +++++++------- test/unit/repository.unit.test.ts | 20 ++++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'test') diff --git a/test/unit/commit.unit.test.ts b/test/unit/commit.unit.test.ts index 5c4d8c7..904a67a 100644 --- a/test/unit/commit.unit.test.ts +++ b/test/unit/commit.unit.test.ts @@ -15,7 +15,7 @@ describe("Commit", () => { repository = await Repository.open(env.BASE_DIR, env.AVAIL_REPO); }); - it("Looks up a commit", async () => { + it("Should look up a commit", async () => { expect.assertions(8); const commit = await Commit.lookup(repository, env.AVAIL_COMMIT); @@ -26,19 +26,19 @@ describe("Commit", () => { expectCommitProperties(commit); }); - it("Looks up a nonexistant commit and throws", async () => { + it("Should look up a nonexistant commit and throw", async () => { expect.assertions(1); await expect(Commit.lookup(repository, env.UNAVAIL_COMMIT)).rejects.toThrow(); }); - it("Looks up if an commit that exists exist", async () => { + 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(); }); - it("Looks up if an nonexistant commit exists", async () => { + 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(); @@ -51,7 +51,7 @@ describe("Commit", () => { commit = await repository.masterCommit(); }); - it("Gets the stats", async () => { + it("Should get the stats", async () => { expect.assertions(4); const stats = await commit.stats(); @@ -63,7 +63,7 @@ describe("Commit", () => { expect(stats).toHaveProperty("files_changed"); }); - it("Gets the diff", async () => { + it("Should get the diff", async () => { expect.assertions(2); const diff = await commit.diff(); @@ -72,7 +72,7 @@ describe("Commit", () => { expect(diff).toBeInstanceOf(Diff); }); - it("Gets the tree", async () => { + it("Should get the tree", async () => { expect.assertions(2); const tree = await commit.tree(); diff --git a/test/unit/repository.unit.test.ts b/test/unit/repository.unit.test.ts index 32a82e8..4fa851b 100644 --- a/test/unit/repository.unit.test.ts +++ b/test/unit/repository.unit.test.ts @@ -18,7 +18,7 @@ function expectRepositoryProperties(repository: Repository) { } describe("Repository", () => { - it("Opens a repository successfully", async () => { + it("Should open a repository", async () => { expect.assertions(8); const repository = await Repository.open(env.BASE_DIR, env.AVAIL_REPO); @@ -29,13 +29,13 @@ describe("Repository", () => { expectRepositoryProperties(repository); }); - it("Fails to open a nonexistant repository", async () => { + it("Should fail to open a nonexistant repository", async () => { expect.assertions(1); await expect(Repository.open(env.BASE_DIR, env.UNAVAIL_REPO)).rejects.toBeInstanceOf(BaseError); }); - it("Opens all repositories", async () => { + it("Should open all repositories", async () => { expect.hasAssertions(); const all_repositories = await Repository.openAll(env.BASE_DIR); @@ -57,19 +57,19 @@ describe("Repository", () => { repository = await Repository.open(env.BASE_DIR, env.AVAIL_REPO); }); - it("Looks up if an object that exists exist", async () => { + it("Should look up if an existent object exists and respond true", async () => { expect.assertions(1); await expect(repository.lookupExists(env.AVAIL_OBJECT)).resolves.toBeTruthy(); }); - it("Looks up if an nonexistant object exists", async () => { + it("Should look up if an nonexistant object exists and respond false", async () => { expect.assertions(1); await expect(repository.lookupExists(env.UNAVAIL_OBJECT)).resolves.toBeFalsy(); }); - it("Gets the master commit", async () => { + it("Should get the master commit", async () => { expect.assertions(8); const master_commit = await repository.masterCommit(); @@ -80,7 +80,7 @@ describe("Repository", () => { expectCommitProperties(master_commit); }); - it("Gets the commits", async () => { + it("Should get the commits", async () => { expect.hasAssertions(); const commits = await repository.commits(); @@ -95,7 +95,7 @@ describe("Repository", () => { } }); - it("Gets the tree", async () => { + it("Should get the tree", async () => { expect.assertions(2); const tree = await repository.tree(); @@ -104,7 +104,7 @@ describe("Repository", () => { expect(tree).toBeInstanceOf(Tree); }); - it("Gets the branches", async () => { + it("Should get the branches", async () => { expect.hasAssertions(); const branches = await repository.branches(); @@ -120,7 +120,7 @@ describe("Repository", () => { } }); - it("Gets the tags", async () => { + it("Should get the tags", async () => { expect.hasAssertions(); const tags = await repository.tags(); -- cgit v1.2.3-18-g5258