add reset to pubsub for tests

v1.18.x
Barış Soner Uşaklı 6 years ago
parent 7d8fc09226
commit 1024a0efa1

@ -52,4 +52,7 @@ module.exports = {
removeAllListeners: function (event) {
get().removeAllListeners(event);
},
reset: function () {
real = null;
},
};

@ -7,6 +7,12 @@ var db = require('./mocks/databasemock');
var pubsub = require('../src/pubsub');
describe('pubsub', function () {
beforeEach(function () {
pubsub.reset();
});
afterEach(function () {
pubsub.reset();
});
it('should use singleHostCluster', function (done) {
var oldValue = nconf.get('singleHostCluster');
var isCluster = nconf.get('isCluster');

Loading…
Cancel
Save