From 29ac9af81d94f7de298d98d9597c73ddd1c93bb0 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 12 Jul 2021 15:27:24 +0200 Subject: Improved the unit tests --- test/util.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/util.ts (limited to 'test/util.ts') diff --git a/test/util.ts b/test/util.ts new file mode 100644 index 0000000..50611d6 --- /dev/null +++ b/test/util.ts @@ -0,0 +1,20 @@ +import { Commit } from "server/src/git/commit"; + +export type EnvironmentVariables = { + BASE_DIR: string, + AVAIL_REPO: string, + UNAVAIL_REPO: string, + AVAIL_OBJECT: string, + UNAVAIL_OBJECT: string, + AVAIL_COMMIT: string, + UNAVAIL_COMMIT: string +} + +export function expectCommitProperties(commit: Commit) { + expect(commit).toHaveProperty("id"); + expect(commit).toHaveProperty("author"); + expect(commit).toHaveProperty("author.name"); + expect(commit).toHaveProperty("author.email"); + expect(commit).toHaveProperty("date"); + expect(commit).toHaveProperty("message"); +} \ No newline at end of file -- cgit v1.2.3-18-g5258