diff options
author | HampusM <hampus@hampusmat.com> | 2021-07-25 14:56:58 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2021-07-25 14:56:58 +0200 |
commit | 7b3292af22a0496007e974b65cd2e34521c9c429 (patch) | |
tree | 8205726e27fa7e5f80cd2a7ffb6c7354a11b6dea /test/unit/misc.unit.test.ts | |
parent | 4f5771726aa8c7b6d4e288df2a79f1ffef55c3a3 (diff) |
Reformated unit tests & the setup and teardown scripts
Diffstat (limited to 'test/unit/misc.unit.test.ts')
-rw-r--r-- | test/unit/misc.unit.test.ts | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/test/unit/misc.unit.test.ts b/test/unit/misc.unit.test.ts index 95a1d2b..c45d8ba 100644 --- a/test/unit/misc.unit.test.ts +++ b/test/unit/misc.unit.test.ts @@ -7,21 +7,21 @@ const env = process.env as EnvironmentVariables; describe("Miscellaneous functions", () => { describe("findAsync", () => { const data: Promise<string>[] = [ - new Promise((resolve) => { + new Promise(resolve => { resolve("hello!"); }), - new Promise((resolve) => { + new Promise(resolve => { resolve("Dad i'm hungry"); }), - new Promise((resolve) => { - resolve("Hi, hungry. I'm dad") + new Promise(resolve => { + resolve("Hi, hungry. I'm dad"); }) ]; - it("Should find an existent item in an array", async () => { + it("Should find an existent item in an array", async() => { expect.assertions(2); - const result = await findAsync(data, async (item) => { + const result = await findAsync(data, async item => { return await item === "Dad i'm hungry"; }); @@ -29,10 +29,10 @@ describe("Miscellaneous functions", () => { expect(result).toEqual("Dad i'm hungry"); }); - it("Should fail to find a nonexistent item in an array", async () => { + it("Should fail to find a nonexistent item in an array", async() => { expect.assertions(1); - const result = await findAsync(data, async (item) => { + const result = await findAsync(data, async item => { return await item === "Hello there"; }); @@ -41,7 +41,7 @@ describe("Miscellaneous functions", () => { }); describe("getFile", () => { - it("Should return the content of a file in a bare git repository", async () => { + it("Should return the content of a file in a bare git repository", async() => { expect.assertions(2); const content = await getFile(env.BASE_DIR, env.AVAIL_REPO, "description"); @@ -50,7 +50,7 @@ describe("Miscellaneous functions", () => { expect(content).toEqual("Unnamed repository; edit this file 'description' to name the repository."); }); - it("Should fail to return the content of a nonexistent file in a bare repository", async () => { + it("Should fail to return the content of a nonexistent file in a bare repository", async() => { expect.assertions(1); await expect(getFile(env.BASE_DIR, env.AVAIL_REPO, "myselfasteem")).rejects.toBeInstanceOf(BaseError); @@ -58,7 +58,7 @@ describe("Miscellaneous functions", () => { }); describe("getDirectory", () => { - it("Should return the content of a directory", async () => { + it("Should return the content of a directory", async() => { expect.assertions(3); const dir = await getDirectory(`${env.BASE_DIR}/${env.AVAIL_REPO}/refs`); @@ -68,7 +68,7 @@ describe("Miscellaneous functions", () => { expect(dir).toContain("tags"); }); - it("Should fail to return the content of a nonexistent directory", async () => { + it("Should fail to return the content of a nonexistent directory", async() => { expect.assertions(1); await expect(getDirectory(`${env.BASE_DIR}/${env.AVAIL_REPO}/something`)).rejects.toBeInstanceOf(BaseError); |