* initial linting of src * fix indent to 2 spaces * Removes unnecessary rules * ignore spec folder for now * Spec linting * Fix spec indent * nits * nits * no no-empty rule
30 lines
875 B
JavaScript
30 lines
875 B
JavaScript
var RedisPubSub = require('../src/Adapters/PubSub/RedisPubSub').RedisPubSub;
|
|
|
|
describe('RedisPubSub', function() {
|
|
|
|
beforeEach(function(done) {
|
|
// Mock redis
|
|
var createClient = jasmine.createSpy('createClient');
|
|
jasmine.mockLibrary('redis', 'createClient', createClient);
|
|
done();
|
|
});
|
|
|
|
it('can create publisher', function() {
|
|
RedisPubSub.createPublisher({redisURL: 'redisAddress'});
|
|
|
|
var redis = require('redis');
|
|
expect(redis.createClient).toHaveBeenCalledWith('redisAddress', { no_ready_check: true });
|
|
});
|
|
|
|
it('can create subscriber', function() {
|
|
RedisPubSub.createSubscriber({redisURL: 'redisAddress'});
|
|
|
|
var redis = require('redis');
|
|
expect(redis.createClient).toHaveBeenCalledWith('redisAddress', { no_ready_check: true });
|
|
});
|
|
|
|
afterEach(function() {
|
|
jasmine.restoreLibrary('redis', 'createClient');
|
|
});
|
|
});
|