diff --git a/server/plugins/messageStorage/sqlite.ts b/server/plugins/messageStorage/sqlite.ts index 7441687d..9f3766fd 100644 --- a/server/plugins/messageStorage/sqlite.ts +++ b/server/plugins/messageStorage/sqlite.ts @@ -23,7 +23,7 @@ try { ); } -const currentSchemaVersion = 1520239200; +export const currentSchemaVersion = 1520239200; const schema = [ // Schema version #1 diff --git a/test/plugins/sqlite.ts b/test/plugins/sqlite.ts index a3c939e7..5f0d8b0a 100644 --- a/test/plugins/sqlite.ts +++ b/test/plugins/sqlite.ts @@ -5,7 +5,7 @@ import {expect} from "chai"; import util from "../util"; import Msg, {MessageType} from "../../server/models/msg"; import Config from "../../server/config"; -import MessageStorage from "../../server/plugins/messageStorage/sqlite"; +import MessageStorage, {currentSchemaVersion} from "../../server/plugins/messageStorage/sqlite"; describe("SQLite Message Storage", function () { // Increase timeout due to unpredictable I/O on CI services @@ -53,11 +53,8 @@ describe("SQLite Message Storage", function () { "SELECT value FROM options WHERE name = 'schema_version'", (err, row) => { expect(err).to.be.null; - - // Should be sqlite.currentSchemaVersion, // compared as string because it's returned as such from the database - expect(row.value).to.equal("1520239200"); - + expect(row.value).to.equal(currentSchemaVersion.toString()); done(); } );