summary refs log tree commit diff
path: root/api/jest/globalSetup.js
blob: 520aa0e2eb769c328041432dd0491215057d5a34 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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();
// });