diff options
author | HampusM <hampus@hampusmat.com> | 2021-07-12 15:27:24 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2021-07-12 15:27:24 +0200 |
commit | 29ac9af81d94f7de298d98d9597c73ddd1c93bb0 (patch) | |
tree | e12208712ce99085783b2c53db691009823b4c3f /test/util.ts | |
parent | a4c70c283c0a77e123694fb2d3687f2efff3eef7 (diff) |
Improved the unit tests
Diffstat (limited to 'test/util.ts')
-rw-r--r-- | test/util.ts | 20 |
1 files changed, 20 insertions, 0 deletions
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 |