Update tests to use promises

This commit is contained in:
Ajay Ramachandran
2021-03-01 21:37:35 -05:00
parent ff4af3786e
commit 46b42da5bd
19 changed files with 274 additions and 259 deletions

View File

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