mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-17 22:10:23 +01:00
feat: #8550, add upgrade script test
flush test db after tests are complete
This commit is contained in:
@@ -105,6 +105,10 @@ winston.info('environment ' + global.env);
|
|||||||
const db = require('../../src/database');
|
const db = require('../../src/database');
|
||||||
module.exports = db;
|
module.exports = db;
|
||||||
|
|
||||||
|
after(async function () {
|
||||||
|
await db.flushdb();
|
||||||
|
});
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000);
|
this.timeout(30000);
|
||||||
await db.init();
|
await db.init();
|
||||||
|
|||||||
13
test/upgrade.js
Normal file
13
test/upgrade.js
Normal file
@@ -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);
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user