feat: #8550, add upgrade script test

flush test db after tests are complete
v1.18.x
Barış Soner Uşaklı 5 years ago
parent 33c5988c34
commit b61a4da50c

@ -105,6 +105,10 @@ winston.info('environment ' + global.env);
const db = require('../../src/database');
module.exports = db;
after(async function () {
await db.flushdb();
});
before(async function () {
this.timeout(30000);
await db.init();

@ -0,0 +1,13 @@
'use strict';
const assert = require('assert');
const db = require('./mocks/databasemock');
const upgrade = require('../src/upgrade');
describe('Upgrade', function () {
it('should get all upgrade scripts', async function () {
const files = await upgrade.getAll();
assert(Array.isArray(files) && files.length > 0);
});
});
Loading…
Cancel
Save