diff options
author | HampusM <hampus@hampusmat.com> | 2021-07-22 11:37:18 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2021-07-22 11:37:18 +0200 |
commit | e00a8a2356ceb6cc2698001ae838abcbdec36188 (patch) | |
tree | a081192f4794cbe1ade50370b50d96128d7ad72f /test | |
parent | 26870af84224600135bf831239b7829008c962cf (diff) |
Fixed the nonexistant repository test & other small stuff
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/repository.unit.test.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/unit/repository.unit.test.ts b/test/unit/repository.unit.test.ts index b11b236..32a82e8 100644 --- a/test/unit/repository.unit.test.ts +++ b/test/unit/repository.unit.test.ts @@ -4,6 +4,7 @@ import { Tree } from "server/src/git/tree"; import { Branch } from "server/src/git/branch"; import { Tag } from "server/src/git/tag"; import { EnvironmentVariables, expectCommitProperties } from "../util"; +import { BaseError } from "server/src/git/error"; const env = process.env as EnvironmentVariables; @@ -20,7 +21,7 @@ describe("Repository", () => { it("Opens a repository successfully", async () => { expect.assertions(8); - const repository = await Repository.open(process.env.BASE_DIR, env.AVAIL_REPO); + const repository = await Repository.open(env.BASE_DIR, env.AVAIL_REPO); expect(repository).toBeDefined(); expect(repository).toBeInstanceOf(Repository); @@ -31,7 +32,7 @@ describe("Repository", () => { it("Fails to open a nonexistant repository", async () => { expect.assertions(1); - await expect(Repository.open(process.env.BASE_DIR, env.UNAVAIL_REPO)).rejects.toThrow(); + await expect(Repository.open(env.BASE_DIR, env.UNAVAIL_REPO)).rejects.toBeInstanceOf(BaseError); }); it("Opens all repositories", async () => { @@ -53,7 +54,7 @@ describe("Repository", () => { let repository: Repository; beforeAll(async () => { - repository = await Repository.open(process.env.BASE_DIR, env.AVAIL_REPO); + repository = await Repository.open(env.BASE_DIR, env.AVAIL_REPO); }); it("Looks up if an object that exists exist", async () => { |