aboutsummaryrefslogtreecommitdiff
path: root/test/unit/repository.unit.test.ts
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-07-22 11:37:18 +0200
committerHampusM <hampus@hampusmat.com>2021-07-22 11:37:18 +0200
commite00a8a2356ceb6cc2698001ae838abcbdec36188 (patch)
treea081192f4794cbe1ade50370b50d96128d7ad72f /test/unit/repository.unit.test.ts
parent26870af84224600135bf831239b7829008c962cf (diff)
Fixed the nonexistant repository test & other small stuff
Diffstat (limited to 'test/unit/repository.unit.test.ts')
-rw-r--r--test/unit/repository.unit.test.ts7
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 () => {