We use the db instance globally with establisheddatabase.

This commit is contained in:
2018-03-19 15:23:54 +01:00
parent 4ab3946181
commit e27d5c7084
3 changed files with 11 additions and 15 deletions

View File

@@ -1,11 +1,9 @@
const SqliteDatabase = require('src/database/sqliteDatabase');
const establishedDatabase = require('src/database/database');
function resetDatabase() {
const database = new SqliteDatabase(':memory:');
return Promise.resolve()
.then(() => database.connect())
// .then(() => database.tearDown())
.then(() => database.setUp());
function resetDatabase() {
return Promise.resolve()
.then(() => establishedDatabase.tearDown())
.then(() => establishedDatabase.setUp())
}
module.exports = resetDatabase;