mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 17:17:50 +01:00
14 lines
637 B
TypeScript
14 lines
637 B
TypeScript
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;
|
|
|
|
assert(
|
|
dbVersion >= 1 && privateVersion >= 1,
|
|
`Versions are not at least 1. db is ${dbVersion}, private is ${privateVersion}`);
|
|
});
|
|
});
|