Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
joaojunceira-zendesk committed May 27, 2024
1 parent decc2ec commit 9a6a19d
Showing 1 changed file with 29 additions and 21 deletions.
50 changes: 29 additions & 21 deletions test/connection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,34 +110,42 @@ describe('given a ConnectionHelper', function () {

it('should connect to both Redis and Replica', function (done) {
process.env.RADAR_MIGRATION_ENABLED = 'true'
/*
use_connection: 'main',
connection_settings: {
main: connection
}
*/
const configurationWithReplica = {
redisReplicaUrl: parseUrl('redis://localhost:26379'),
connection_settings: {
redis: {
host: 'localhost',
port: 16379
},
sentinel: {
// sentinel master name is required
id: 'mymaster',
sentinels: [
{
host: 'localhost',
port: 26379
},
{
host: 'localhost',
port: 26380
},
{
host: 'localhost',
port: 26381
}]
main: {
redis: {
host: 'localhost',
port: 16379
},
sentinel: {
// sentinel master name is required
id: 'mymaster',
sentinels: [
{
host: 'localhost',
port: 26379
},
{
host: 'localhost',
port: 26380
},
{
host: 'localhost',
port: 26381
}]
}
}
}
}
const config = JSON.parse(JSON.stringify(configurationWithReplica))
config.use_connection = 'sentinel'
config.use_connection = 'main'
const connection = ConnectionHelper.connection(config)
connection.establish(function () {
assert.equal(connection.config.id, configurationWithReplica.connection_settings.sentinel.id)
Expand Down

0 comments on commit 9a6a19d

Please sign in to comment.