1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-25 03:33:33 +01:00
server/api/jest/globalSetup.js
2021-09-20 23:35:37 +02:00

21 lines
541 B
JavaScript

const { Config, initDatabase } = require("@fosscord/util");
const fs = require("fs");
const path = require("path");
const { FosscordServer } = require("../dist/Server");
const Server = new FosscordServer({ port: 3001 });
global.server = Server;
module.exports = async () => {
try {
fs.unlinkSync(path.join(process.cwd(), "database.db"));
} catch {}
await initDatabase();
await Config.init();
Config.get().limits.rate.disabled = true;
return await Server.start();
};
// afterAll(async () => {
// return await Server.stop();
// });