@@ -26,7 +26,23 @@ describe('redis-commands', function () {
2626 } ) ;
2727 } ) ;
2828
29- describe ( '.hasFlag' , function ( ) {
29+ describe ( '.exists()' , function ( ) {
30+ it ( 'should return true for existing commands' , function ( ) {
31+ expect ( commands . exists ( 'set' ) ) . to . eql ( true ) ;
32+ expect ( commands . exists ( 'get' ) ) . to . eql ( true ) ;
33+ expect ( commands . exists ( 'cluster' ) ) . to . eql ( true ) ;
34+ expect ( commands . exists ( 'quit' ) ) . to . eql ( true ) ;
35+ expect ( commands . exists ( 'config' ) ) . to . eql ( true ) ;
36+ } ) ;
37+
38+ it ( 'should return false for non-existing commands' , function ( ) {
39+ expect ( commands . exists ( 'SET' ) ) . to . eql ( false ) ;
40+ expect ( commands . exists ( 'set get' ) ) . to . eql ( false ) ;
41+ expect ( commands . exists ( 'other-command' ) ) . to . eql ( false ) ;
42+ } ) ;
43+ } ) ;
44+
45+ describe ( '.hasFlag()' , function ( ) {
3046 it ( 'should return true if the command has the flag' , function ( ) {
3147 expect ( commands . hasFlag ( 'set' , 'write' ) ) . to . eql ( true ) ;
3248 expect ( commands . hasFlag ( 'set' , 'denyoom' ) ) . to . eql ( true ) ;
@@ -41,7 +57,7 @@ describe('redis-commands', function () {
4157 } ) ;
4258 } ) ;
4359
44- describe ( '.getKeyIndexes' , function ( ) {
60+ describe ( '.getKeyIndexes() ' , function ( ) {
4561 var index = commands . getKeyIndexes ;
4662
4763 it ( 'should return key indexes' , function ( ) {
0 commit comments