mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-06 11:36:58 +03:00
migrate to typescript
This commit is contained in:
committed by
Dainius Dauksevicius
parent
c462323dd5
commit
08d27265fc
11
test/cases/dbUpgrade.ts
Normal file
11
test/cases/dbUpgrade.ts
Normal 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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user