mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-11 05:02:37 +01:00
added setup for jest tests
This commit is contained in:
parent
503c0d7b60
commit
d107c66358
2
api/jest/setup.js
Normal file
2
api/jest/setup.js
Normal file
@ -0,0 +1,2 @@
|
||||
jest.spyOn(global.console, "log").mockImplementation(() => jest.fn());
|
||||
jest.spyOn(global.console, "info").mockImplementation(() => jest.fn());
|
@ -85,7 +85,7 @@
|
||||
"typeorm": "^0.2.37"
|
||||
},
|
||||
"jest": {
|
||||
"setupFilesAfterEnv": [
|
||||
"setupFiles": [
|
||||
"<rootDir>/jest/setup.js",
|
||||
"<rootDir>/scripts/setup_test.js"
|
||||
],
|
||||
|
@ -1 +1,13 @@
|
||||
// TODO: start api
|
||||
const fs = require("fs");
|
||||
const { FosscordServer } = require("../dist/Server");
|
||||
const Server = new FosscordServer({ port: 3001 });
|
||||
(async () => {
|
||||
try {
|
||||
fs.unlinkSync(`${__dirname}/database.db`);
|
||||
} catch {}
|
||||
return await Server.start();
|
||||
})();
|
||||
|
||||
// afterAll(async () => {
|
||||
// return await Server.stop();
|
||||
// });
|
||||
|
Loading…
Reference in New Issue
Block a user