summary refs log tree commit diff
path: root/api/scripts
diff options
context:
space:
mode:
authorxnacly <matteogropp@protonmail.com>2021-08-30 16:21:54 +0200
committerxnacly <matteogropp@protonmail.com>2021-08-30 16:21:54 +0200
commitd107c66358592336d9f6ba8d263b645c242b4c1e (patch)
tree7516382d1ce79ff3357a0560f87e847d426f1c5c /api/scripts
parentadded jest config, installed supertest (diff)
downloadserver-d107c66358592336d9f6ba8d263b645c242b4c1e.tar.xz
added setup for jest tests
Diffstat (limited to 'api/scripts')
-rw-r--r--api/scripts/setup_test.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/api/scripts/setup_test.js b/api/scripts/setup_test.js
index 4b692f7c..95bf2e40 100644
--- a/api/scripts/setup_test.js
+++ b/api/scripts/setup_test.js
@@ -1 +1,13 @@
-// TODO: start api
+const fs = require("fs");
+const { FosscordServer } = require("../dist/Server");
+const Server = new FosscordServer({ port: 3001 });
+(async () => {
+	try {
+		fs.unlinkSync(`${__dirname}/database.db`);
+	} catch {}
+	return await Server.start();
+})();
+
+// afterAll(async () => {
+// 	return await Server.stop();
+// });