Configured redis to flush before each test and changed default test

redis database
This commit is contained in:
Wyatt Johnson
2017-07-07 08:57:56 -06:00
parent db371d1c82
commit 23573501bd
3 changed files with 38 additions and 7 deletions
+15
View File
@@ -0,0 +1,15 @@
const {createClient} = require('../../services/redis');
// Create a redis client to use for clearing the database.
const client = createClient();
module.exports.clearDB = () =>
new Promise((resolve, reject) =>
client.flushdb((err) => {
if (err) {
return reject(err);
}
return resolve();
})
);
+3
View File
@@ -0,0 +1,3 @@
const redis = require('../helpers/redis');
beforeEach(() => redis.clearDB());