summary refs log tree commit diff
path: root/api/scripts/globalSetup.js
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
commit26be2f9a1dcbcb1ecc5abb100b1920bb28597938 (patch)
treee498d65454fdc0faaf583ef638c22f3030d5a001 /api/scripts/globalSetup.js
parentremoved logging of database queries (diff)
downloadserver-26be2f9a1dcbcb1ecc5abb100b1920bb28597938.tar.xz
fixed globalSetup for jest
Diffstat (limited to 'api/scripts/globalSetup.js')
-rw-r--r--api/scripts/globalSetup.js14
1 files changed, 14 insertions, 0 deletions
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(); +// });