mirror of
https://github.com/spacebarchat/server.git
synced 2026-04-05 02:05:45 +00:00
fixed globalSetup for jest
This commit is contained in:
14
api/scripts/globalSetup.js
Normal file
14
api/scripts/globalSetup.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const fs = require("fs");
|
||||
const { FosscordServer } = require("../dist/Server");
|
||||
const Server = new FosscordServer({ port: 3001 });
|
||||
global.server = Server;
|
||||
module.exports = async () => {
|
||||
try {
|
||||
fs.unlinkSync(`${__dirname}/../database.db`);
|
||||
} catch {}
|
||||
return await Server.start();
|
||||
};
|
||||
|
||||
// afterAll(async () => {
|
||||
// return await Server.stop();
|
||||
// });
|
||||
Reference in New Issue
Block a user