@@ -140,6 +140,31 @@ describe('Cluster', () => {
140
140
assert . equal ( ids . size , totalNodes ) ;
141
141
} , GLOBAL . CLUSTERS . WITH_REPLICAS ) ;
142
142
143
+ testUtils . testWithCluster ( 'getMasters should be backwards competiable (without `minimizeConnections`)' , async cluster => {
144
+ const masters = cluster . getMasters ( ) ;
145
+ assert . ok ( Array . isArray ( masters ) ) ;
146
+ for ( const master of masters ) {
147
+ assert . equal ( typeof master . id , 'string' ) ;
148
+ assert . ok ( master . client instanceof RedisClient ) ;
149
+ }
150
+ } , {
151
+ ...GLOBAL . CLUSTERS . OPEN ,
152
+ clusterConfiguration : {
153
+ minimizeConnections : undefined // reset to default
154
+ }
155
+ } ) ;
156
+
157
+ testUtils . testWithCluster ( 'getSlotMaster should be backwards competiable (without `minimizeConnections`)' , async cluster => {
158
+ const master = cluster . getSlotMaster ( 0 ) ;
159
+ assert . equal ( typeof master . id , 'string' ) ;
160
+ assert . ok ( master . client instanceof RedisClient ) ;
161
+ } , {
162
+ ...GLOBAL . CLUSTERS . OPEN ,
163
+ clusterConfiguration : {
164
+ minimizeConnections : undefined // reset to default
165
+ }
166
+ } ) ;
167
+
143
168
describe ( 'minimizeConnections' , ( ) => {
144
169
testUtils . testWithCluster ( 'false' , async cluster => {
145
170
for ( const master of cluster . masters ) {
0 commit comments