aboutsummaryrefslogtreecommitdiff
path: root/test/int
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-07-29 17:10:54 +0200
committerHampusM <hampus@hampusmat.com>2021-07-29 17:10:54 +0200
commit93a4a8bf924588cd866714b86ec8f16f8d51dec0 (patch)
treea86d3ecba5838fac11042e8ae257dfe1bd3840cb /test/int
parent9d6d2ce8cf34af6e787dae901ee3e5914c4c0fa4 (diff)
Organized tsconfigs, fixed tests and improved some backend functions
Diffstat (limited to 'test/int')
-rw-r--r--test/int/api.int.test.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/int/api.int.test.ts b/test/int/api.int.test.ts
index b93a947..11478ad 100644
--- a/test/int/api.int.test.ts
+++ b/test/int/api.int.test.ts
@@ -265,7 +265,15 @@ describe("API", () => {
beforeAll(async() => {
const body = new Readable({ read: () => null });
- const head = /^[a-f0-9]+/.exec((await readFile(`${env.BASE_DIR}/${env.AVAIL_REPO}/FETCH_HEAD`)).toString())[0];
+ let head = (await readFile(`${env.BASE_DIR}/${env.AVAIL_REPO}/FETCH_HEAD`)).toString();
+
+ const find_head = /^[a-f0-9]+/.exec(head);
+
+ if(!find_head) {
+ throw(new Error("Failed to get repository head!"));
+ }
+
+ head = find_head[0];
body.push(`0098want ${head} multi_ack_detailed no-done side-band-64k thin-pack ofs-delta deepen-since deepen-not agent=git/2.32.0\n00000009done\n`);
body.push(null);