1 files changed, 6 insertions, 1 deletions
diff --git a/api/jest/globalSetup.js b/api/jest/globalSetup.js
index 98e70fb9..520aa0e2 100644
--- a/api/jest/globalSetup.js
+++ b/api/jest/globalSetup.js
@@ -1,3 +1,4 @@
+const { Config, initDatabase } = require("@fosscord/util");
const fs = require("fs");
const path = require("path");
const { FosscordServer } = require("../dist/Server");
@@ -5,8 +6,12 @@ const Server = new FosscordServer({ port: 3001 });
global.server = Server;
module.exports = async () => {
try {
- fs.unlinkSync(path.join(__dirname, "..", "database.db"));
+ fs.unlinkSync(path.join(process.cwd(), "database.db"));
} catch {}
+
+ await initDatabase();
+ await Config.init();
+ Config.get().limits.rate.disabled = true;
return await Server.start();
};
|