mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2026-01-28 13:20:48 +03:00
Use assert in test
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
import assert from "assert";
|
||||
|
||||
import {db, privateDB} from "../../src/databases/databases";
|
||||
|
||||
describe("dbUpgrade", () => {
|
||||
it("Should update the database version when starting the application", async () => {
|
||||
const dbVersion = (await db.prepare("get", "SELECT key, value FROM config where key = ?", ["version"])).value;
|
||||
const privateVersion = (await privateDB.prepare("get", "SELECT key, value FROM config where key = ?", ["version"])).value;
|
||||
if (dbVersion >= 1 && privateVersion >= 1) return;
|
||||
else return `Versions are not at least 1. db is ${dbVersion}, private is ${privateVersion}`;
|
||||
|
||||
assert(
|
||||
dbVersion >= 1 && privateVersion >= 1,
|
||||
`Versions are not at least 1. db is ${dbVersion}, private is ${privateVersion}`);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user