LiveQuery: Add options for Redis (#5584)
Closes: https://github.com/parse-community/parse-server/issues/5387
This commit is contained in:
@@ -28,6 +28,7 @@ describe('ParsePubSub', function() {
|
||||
it('can create redis publisher', function() {
|
||||
ParsePubSub.createPublisher({
|
||||
redisURL: 'redisURL',
|
||||
redisOptions: { socket_keepalive: true },
|
||||
});
|
||||
|
||||
const RedisPubSub = require('../lib/Adapters/PubSub/RedisPubSub')
|
||||
@@ -36,6 +37,7 @@ describe('ParsePubSub', function() {
|
||||
.EventEmitterPubSub;
|
||||
expect(RedisPubSub.createPublisher).toHaveBeenCalledWith({
|
||||
redisURL: 'redisURL',
|
||||
redisOptions: { socket_keepalive: true },
|
||||
});
|
||||
expect(EventEmitterPubSub.createPublisher).not.toHaveBeenCalled();
|
||||
});
|
||||
@@ -54,6 +56,7 @@ describe('ParsePubSub', function() {
|
||||
it('can create redis subscriber', function() {
|
||||
ParsePubSub.createSubscriber({
|
||||
redisURL: 'redisURL',
|
||||
redisOptions: { socket_keepalive: true },
|
||||
});
|
||||
|
||||
const RedisPubSub = require('../lib/Adapters/PubSub/RedisPubSub')
|
||||
@@ -62,6 +65,7 @@ describe('ParsePubSub', function() {
|
||||
.EventEmitterPubSub;
|
||||
expect(RedisPubSub.createSubscriber).toHaveBeenCalledWith({
|
||||
redisURL: 'redisURL',
|
||||
redisOptions: { socket_keepalive: true },
|
||||
});
|
||||
expect(EventEmitterPubSub.createSubscriber).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -9,19 +9,27 @@ describe('RedisPubSub', function() {
|
||||
});
|
||||
|
||||
it('can create publisher', function() {
|
||||
RedisPubSub.createPublisher({ redisURL: 'redisAddress' });
|
||||
RedisPubSub.createPublisher({
|
||||
redisURL: 'redisAddress',
|
||||
redisOptions: { socket_keepalive: true },
|
||||
});
|
||||
|
||||
const redis = require('redis');
|
||||
expect(redis.createClient).toHaveBeenCalledWith('redisAddress', {
|
||||
socket_keepalive: true,
|
||||
no_ready_check: true,
|
||||
});
|
||||
});
|
||||
|
||||
it('can create subscriber', function() {
|
||||
RedisPubSub.createSubscriber({ redisURL: 'redisAddress' });
|
||||
RedisPubSub.createSubscriber({
|
||||
redisURL: 'redisAddress',
|
||||
redisOptions: { socket_keepalive: true },
|
||||
});
|
||||
|
||||
const redis = require('redis');
|
||||
expect(redis.createClient).toHaveBeenCalledWith('redisAddress', {
|
||||
socket_keepalive: true,
|
||||
no_ready_check: true,
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user