summary refs log tree commit diff
diff options
context:
space:
mode:
authorxnacly <matteogropp@protonmail.com>2021-09-01 22:10:44 +0200
committerxnacly <matteogropp@protonmail.com>2021-09-01 22:10:44 +0200
commit5175557809714ec3bbbda822ce121f1c25cb597f (patch)
tree286acad53a937d5e3da1711cf4c336464cf1da84
parentremoved logging of database queries (diff)
downloadserver-5175557809714ec3bbbda822ce121f1c25cb597f.tar.xz
fixed globalSetup for jest
-rw-r--r--api/scripts/globalSetup.js (renamed from api/scripts/setup_test.js)7
-rw-r--r--cdn/package-lock.json42
2 files changed, 29 insertions, 20 deletions
diff --git a/api/scripts/setup_test.js b/api/scripts/globalSetup.js
index 95bf2e40..76cd8e0d 100644
--- a/api/scripts/setup_test.js
+++ b/api/scripts/globalSetup.js
@@ -1,12 +1,13 @@
 const fs = require("fs");
 const { FosscordServer } = require("../dist/Server");
 const Server = new FosscordServer({ port: 3001 });
-(async () => {
+global.server = Server;
+module.exports = async () => {
 	try {
-		fs.unlinkSync(`${__dirname}/database.db`);
+		fs.unlinkSync(`${__dirname}/../database.db`);
 	} catch {}
 	return await Server.start();
-})();
+};
 
 // afterAll(async () => {
 // 	return await Server.stop();
diff --git a/cdn/package-lock.json b/cdn/package-lock.json
index 673395a5..a94f1409 100644
--- a/cdn/package-lock.json
+++ b/cdn/package-lock.json
@@ -53,26 +53,30 @@
 			"hasInstallScript": true,
 			"license": "GPLV3",
 			"dependencies": {
-				"ajv": "^8.5.0",
+				"ajv": "^8.6.2",
 				"amqplib": "^0.8.0",
+				"class-validator": "^0.13.1",
 				"dot-prop": "^6.0.1",
 				"env-paths": "^2.2.1",
 				"jsonwebtoken": "^8.5.1",
-				"missing-native-js-functions": "^1.2.10",
-				"mongodb": "^3.6.9",
-				"mongoose": "^5.13.7",
-				"mongoose-autopopulate": "^0.12.3",
+				"lambert-server": "^1.2.10",
+				"missing-native-js-functions": "^1.2.11",
 				"node-fetch": "^2.6.1",
-				"typescript": "^4.1.3"
+				"patch-package": "^6.4.7",
+				"pg": "^8.7.1",
+				"reflect-metadata": "^0.1.13",
+				"sqlite3": "^5.0.2",
+				"typeorm": "^0.2.37",
+				"typescript": "^4.4.2",
+				"typescript-json-schema": "^0.50.1"
 			},
 			"devDependencies": {
 				"@types/amqplib": "^0.8.1",
 				"@types/jsonwebtoken": "^8.5.0",
-				"@types/mongodb": "^3.6.9",
 				"@types/mongoose-autopopulate": "^0.10.1",
-				"@types/mongoose-lean-virtuals": "^0.5.1",
 				"@types/node": "^14.17.9",
-				"@types/node-fetch": "^2.5.12"
+				"@types/node-fetch": "^2.5.12",
+				"jest": "^27.0.6"
 			}
 		},
 		"node_modules/@babel/code-frame": {
@@ -5965,22 +5969,26 @@
 			"requires": {
 				"@types/amqplib": "^0.8.1",
 				"@types/jsonwebtoken": "^8.5.0",
-				"@types/mongodb": "^3.6.9",
 				"@types/mongoose-autopopulate": "^0.10.1",
-				"@types/mongoose-lean-virtuals": "^0.5.1",
 				"@types/node": "^14.17.9",
 				"@types/node-fetch": "^2.5.12",
-				"ajv": "^8.5.0",
+				"ajv": "^8.6.2",
 				"amqplib": "^0.8.0",
+				"class-validator": "^0.13.1",
 				"dot-prop": "^6.0.1",
 				"env-paths": "^2.2.1",
+				"jest": "^27.0.6",
 				"jsonwebtoken": "^8.5.1",
-				"missing-native-js-functions": "^1.2.10",
-				"mongodb": "^3.6.9",
-				"mongoose": "^5.13.7",
-				"mongoose-autopopulate": "^0.12.3",
+				"lambert-server": "^1.2.10",
+				"missing-native-js-functions": "^1.2.11",
 				"node-fetch": "^2.6.1",
-				"typescript": "^4.1.3"
+				"patch-package": "^6.4.7",
+				"pg": "^8.7.1",
+				"reflect-metadata": "^0.1.13",
+				"sqlite3": "^5.0.2",
+				"typeorm": "^0.2.37",
+				"typescript": "^4.4.2",
+				"typescript-json-schema": "^0.50.1"
 			}
 		},
 		"@istanbuljs/load-nyc-config": {