1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

add positive test for LINDEX

This commit is contained in:
leibale
2021-11-16 14:10:59 -05:00
parent 641d53414f
commit 51b640bca9

View File

@@ -10,12 +10,23 @@ describe('LINDEX', () => {
);
});
testUtils.testWithClient('client.lIndex', async client => {
assert.equal(
await client.lIndex('key', 0),
null
);
}, GLOBAL.SERVERS.OPEN);
describe('client.lIndex', () => {
testUtils.testWithClient('null', async client => {
assert.equal(
await client.lIndex('key', 0),
null
);
}, GLOBAL.SERVERS.OPEN);
testUtils.testWithClient('with value', async client => {
const [, lIndexReply] = await Promise.all([
client.lPush('key', 'element'),
client.lIndex('key', 0)
]);
assert.equal(lIndexReply, 'element');
}, GLOBAL.SERVERS.OPEN);
});
testUtils.testWithCluster('cluster.lIndex', async cluster => {
assert.equal(