diff --git a/lib/client/index.spec.ts b/lib/client/index.spec.ts index 3e1bbd6aad..3e57ff3dcf 100644 --- a/lib/client/index.spec.ts +++ b/lib/client/index.spec.ts @@ -108,13 +108,18 @@ describe('Client', () => { password: 'wrongpassword' }); + let message; + if (isRedisVersionGreaterThan([6, 2])) { + message = 'WRONGPASS invalid username-password pair or user is disabled.'; + } else if (isRedisVersionGreaterThan([6])) { + message = 'WRONGPASS invalid username-password pair'; + } else { + message = 'ERR invalid password'; + } + await assert.rejects( client.connect(), - { - message: isRedisVersionGreaterThan([6]) ? - 'WRONGPASS invalid username-password pair or user is disabled.' : - 'ERR invalid password' - } + { message } ); assert.equal(client.isOpen, false); diff --git a/lib/commands/ACL_GETUSER.spec.ts b/lib/commands/ACL_GETUSER.spec.ts index c43cdc364a..6bd0403383 100644 --- a/lib/commands/ACL_GETUSER.spec.ts +++ b/lib/commands/ACL_GETUSER.spec.ts @@ -1,5 +1,5 @@ import { strict as assert } from 'assert'; -import { describeHandleMinimumRedisVersion, itWithClient, TestRedisServers } from '../test-utils'; +import { describeHandleMinimumRedisVersion, isRedisVersionGreaterThan, itWithClient, TestRedisServers } from '../test-utils'; import { transformArguments } from './ACL_GETUSER'; describe('ACL GETUSER', () => { @@ -20,7 +20,7 @@ describe('ACL GETUSER', () => { passwords: [], commands: '+@all', keys: ['*'], - channels: ['*'] + channels: isRedisVersionGreaterThan([6, 2]) ? ['*'] : undefined } ); }); diff --git a/lib/commands/HELLO.spec.ts b/lib/commands/HELLO.spec.ts index 7642f739d9..db4604afea 100644 --- a/lib/commands/HELLO.spec.ts +++ b/lib/commands/HELLO.spec.ts @@ -73,5 +73,7 @@ describe('HELLO', () => { modules: [] } ); + }, { + minimumRedisVersion: [6, 2] }); });