migrate to typescript

This commit is contained in:
Dainius Daukševičius
2020-10-17 21:56:54 +03:00
committed by Dainius Dauksevicius
parent c462323dd5
commit 08d27265fc
120 changed files with 5002 additions and 4711 deletions

11
test/cases/dbUpgrade.ts Normal file
View File

@@ -0,0 +1,11 @@
import {db, privateDB} from '../../src/databases/databases';
import {Done} from '../utils';
describe('dbUpgrade', () => {
it('Should update the database version when starting the application', (done: Done) => {
let dbVersion = db.prepare('get', 'SELECT key, value FROM config where key = ?', ['version']).value;
let privateVersion = privateDB.prepare('get', 'SELECT key, value FROM config where key = ?', ['version']).value;
if (dbVersion >= 1 && privateVersion >= 1) done();
else done('Versions are not at least 1. db is ' + dbVersion + ', private is ' + privateVersion);
});
});