aboutsummaryrefslogtreecommitdiff
path: root/test/unit/commit.unit.test.ts
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-07-25 14:56:58 +0200
committerHampusM <hampus@hampusmat.com>2021-07-25 14:56:58 +0200
commit7b3292af22a0496007e974b65cd2e34521c9c429 (patch)
tree8205726e27fa7e5f80cd2a7ffb6c7354a11b6dea /test/unit/commit.unit.test.ts
parent4f5771726aa8c7b6d4e288df2a79f1ffef55c3a3 (diff)
Reformated unit tests & the setup and teardown scripts
Diffstat (limited to 'test/unit/commit.unit.test.ts')
-rw-r--r--test/unit/commit.unit.test.ts24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/unit/commit.unit.test.ts b/test/unit/commit.unit.test.ts
index 81dc7c8..2a43855 100644
--- a/test/unit/commit.unit.test.ts
+++ b/test/unit/commit.unit.test.ts
@@ -9,11 +9,11 @@ const env = process.env as EnvironmentVariables;
describe("Commit", () => {
let repository: Repository;
- beforeAll(async () => {
+ beforeAll(async() => {
repository = await Repository.open(env.BASE_DIR, env.AVAIL_REPO);
});
- it("Should look up a commit", async () => {
+ it("Should look up a commit", async() => {
expect.assertions(8);
const commit = await Commit.lookup(repository, env.AVAIL_COMMIT);
@@ -24,19 +24,19 @@ describe("Commit", () => {
expectCommitProperties(commit);
});
- it("Should look up a nonexistant commit and throw", 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("Should look up if an existent commit exists and respond true", 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("Should look up if an nonexistant commit exists and respond false", 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();
@@ -45,11 +45,11 @@ describe("Commit", () => {
describe("Methods", () => {
let commit: Commit;
- beforeAll(async () => {
+ beforeAll(async() => {
commit = await repository.masterCommit();
});
- it("Should get the stats", async () => {
+ it("Should get the stats", async() => {
expect.assertions(4);
const stats = await commit.stats();
@@ -61,7 +61,7 @@ describe("Commit", () => {
expect(stats).toHaveProperty("files_changed");
});
- it("Should get the diff", async () => {
+ it("Should get the diff", async() => {
expect.assertions(2);
const diff = await commit.diff();
@@ -69,8 +69,8 @@ describe("Commit", () => {
expect(diff).toBeDefined();
expect(diff).toBeInstanceOf(Diff);
});
-
- it("Should get the tree", async () => {
+
+ it("Should get the tree", async() => {
expect.assertions(2);
const tree = await commit.tree();
@@ -78,5 +78,5 @@ describe("Commit", () => {
expect(tree).toBeDefined();
expect(tree).toBeInstanceOf(Tree);
});
- });
-});
+ });
+}); \ No newline at end of file