mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-23 08:43:02 +00:00
🐛 fix unittests
This commit is contained in:
1 parent
022e82023d
commit
ecc7683c02
4 files changed
+81
-20
No files matched your search
@@ -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
@@ -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());
|
||||
Reference in new issue
Block a user