Test: Fix tests

Test: Add clear stats test

Test: Attempt to fix tests

Test: Add test for disable auth

Update README
This commit is contained in:
Nelson Chan
2021-11-04 23:19:31 +08:00
parent f65cc655c0
commit 07742799ed
9 changed files with 101 additions and 35 deletions

View File

@@ -176,7 +176,7 @@ exports.entryPage = "dashboard";
(async () => {
Database.init(args);
await initDatabase();
await initDatabase(testMode);
exports.entryPage = await setting("entryPage");
@@ -1417,14 +1417,14 @@ async function getMonitorJSONList(userID) {
return result;
}
async function initDatabase() {
async function initDatabase(testMode = false) {
if (! fs.existsSync(Database.path)) {
console.log("Copying Database");
fs.copyFileSync(Database.templatePath, Database.path);
}
console.log("Connecting to the Database");
await Database.connect();
await Database.connect(testMode);
console.log("Connected");
// Patch the database