You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
Update doctest client with latest v4 release (#2844)
This commit is contained in:
@@ -13,32 +13,22 @@ describe('ACL GETUSER', () => {
|
||||
});
|
||||
|
||||
testUtils.testWithClient('client.aclGetUser', async client => {
|
||||
const expectedReply: any = {
|
||||
passwords: [],
|
||||
commands: '+@all',
|
||||
};
|
||||
const reply = await client.aclGetUser('default');
|
||||
|
||||
assert.ok(Array.isArray(reply.passwords));
|
||||
assert.equal(typeof reply.commands, 'string');
|
||||
assert.ok(Array.isArray(reply.flags));
|
||||
|
||||
if (testUtils.isVersionGreaterThan([7])) {
|
||||
expectedReply.flags = ['on', 'nopass'];
|
||||
expectedReply.keys = '~*';
|
||||
expectedReply.channels = '&*';
|
||||
expectedReply.selectors = [];
|
||||
assert.equal(typeof reply.keys, 'string');
|
||||
assert.equal(typeof reply.channels, 'string');
|
||||
assert.ok(Array.isArray(reply.selectors));
|
||||
} else {
|
||||
expectedReply.keys = ['*'];
|
||||
expectedReply.selectors = undefined;
|
||||
assert.ok(Array.isArray(reply.keys));
|
||||
|
||||
if (testUtils.isVersionGreaterThan([6, 2])) {
|
||||
expectedReply.flags = ['on', 'allkeys', 'allchannels', 'allcommands', 'nopass'];
|
||||
expectedReply.channels = ['*'];
|
||||
} else {
|
||||
expectedReply.flags = ['on', 'allkeys', 'allcommands', 'nopass'];
|
||||
expectedReply.channels = undefined;
|
||||
}
|
||||
if (testUtils.isVersionGreaterThan([6, 2])) {
|
||||
assert.ok(Array.isArray(reply.channels));
|
||||
}
|
||||
}
|
||||
|
||||
assert.deepEqual(
|
||||
await client.aclGetUser('default'),
|
||||
expectedReply
|
||||
);
|
||||
}, GLOBAL.SERVERS.OPEN);
|
||||
});
|
||||
|
Reference in New Issue
Block a user