1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-15 23:22:38 +01:00
server/api/jest/globalSetup.js

21 lines
541 B
JavaScript
Raw Normal View History

2021-09-20 23:35:37 +02:00
const { Config, initDatabase } = require("@fosscord/util");
2021-09-18 01:50:29 +02:00
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 {
2021-09-20 23:35:37 +02:00
fs.unlinkSync(path.join(process.cwd(), "database.db"));
2021-09-18 01:50:29 +02:00
} catch {}
2021-09-20 23:35:37 +02:00
await initDatabase();
await Config.init();
Config.get().limits.rate.disabled = true;
2021-09-18 01:50:29 +02:00
return await Server.start();
};
// afterAll(async () => {
// return await Server.stop();
// });