@@ -2,6 +2,7 @@ import { strict as assert } from 'assert';
2
2
import testUtils , { GLOBAL , waitTillBeenCalled } from '../test-utils' ;
3
3
import RedisCluster from '.' ;
4
4
import { ClusterSlotStates } from '../commands/CLUSTER_SETSLOT' ;
5
+ import { commandOptions } from '../command-options' ;
5
6
import { SQUARE_SCRIPT } from '../client/index.spec' ;
6
7
import { RootNodesUnavailableError } from '../errors' ;
7
8
import { spy } from 'sinon' ;
@@ -178,6 +179,20 @@ describe('Cluster', () => {
178
179
await assert . rejects ( cluster . mGet ( [ 'a' , 'b' ] ) ) ;
179
180
} , GLOBAL . CLUSTERS . OPEN ) ;
180
181
182
+ testUtils . testWithCluster ( 'commandOptions' , async cluster => {
183
+ const key = `test-${ Math . random ( ) } ` ; // random() for random cluster slot
184
+
185
+ const [ blPopReply ] = await Promise . all ( [
186
+ cluster . blPop ( commandOptions ( { isolated : true } ) , key , 1 ) ,
187
+ cluster . lPush ( key , 'element' ) ,
188
+ ] ) ;
189
+
190
+ assert . deepEqual (
191
+ blPopReply ,
192
+ { key, element : 'element' }
193
+ ) ;
194
+ } , GLOBAL . CLUSTERS . OPEN ) ;
195
+
181
196
describe ( 'minimizeConnections' , ( ) => {
182
197
testUtils . testWithCluster ( 'false' , async cluster => {
183
198
for ( const master of cluster . masters ) {
0 commit comments