From 26be2f9a1dcbcb1ecc5abb100b1920bb28597938 Mon Sep 17 00:00:00 2001 From: xnacly Date: Wed, 1 Sep 2021 22:10:44 +0200 Subject: fixed globalSetup for jest --- api/scripts/globalSetup.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 api/scripts/globalSetup.js (limited to 'api/scripts/globalSetup.js') diff --git a/api/scripts/globalSetup.js b/api/scripts/globalSetup.js new file mode 100644 index 00000000..76cd8e0d --- /dev/null +++ b/api/scripts/globalSetup.js @@ -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(); +// }); -- cgit 1.5.1