summary refs log tree commit diff
path: root/api
diff options
context:
space:
mode:
authorxnacly <matteogropp@protonmail.com>2021-09-01 22:10:44 +0200
committerxnacly <matteogropp@protonmail.com>2021-09-01 22:10:44 +0200
commit5175557809714ec3bbbda822ce121f1c25cb597f (patch)
tree286acad53a937d5e3da1711cf4c336464cf1da84 /api
parentremoved logging of database queries (diff)
downloadserver-5175557809714ec3bbbda822ce121f1c25cb597f.tar.xz
fixed globalSetup for jest
Diffstat (limited to 'api')
-rw-r--r--api/scripts/globalSetup.js (renamed from api/scripts/setup_test.js)7
1 files changed, 4 insertions, 3 deletions
diff --git a/api/scripts/setup_test.js b/api/scripts/globalSetup.js

index 95bf2e40..76cd8e0d 100644 --- a/api/scripts/setup_test.js +++ b/api/scripts/globalSetup.js
@@ -1,12 +1,13 @@ const fs = require("fs"); const { FosscordServer } = require("../dist/Server"); const Server = new FosscordServer({ port: 3001 }); -(async () => { +global.server = Server; +module.exports = async () => { try { - fs.unlinkSync(`${__dirname}/database.db`); + fs.unlinkSync(`${__dirname}/../database.db`); } catch {} return await Server.start(); -})(); +}; // afterAll(async () => { // return await Server.stop();