🐛 fix unittests

This commit is contained in:
Flam3rboy committed 2021-09-20 23:35:37 +02:00
1 parent 022e82023d
commit ecc7683c02
4 files changed
+81 -20

No files matched your search

+6 -1
View File
@@ -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();
};
+2 -2
View File
@@ -1,2 +1,2 @@
// jest.spyOn(global.console, "log").mockImplementation(() => jest.fn());
// jest.spyOn(global.console, "info").mockImplementation(() => jest.fn());
jest.spyOn(global.console, "log").mockImplementation(() => jest.fn());
jest.spyOn(global.console, "info").mockImplementation(() => jest.fn());