You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
add positive test for LINDEX
This commit is contained in:
@@ -10,13 +10,24 @@ describe('LINDEX', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
testUtils.testWithClient('client.lIndex', async client => {
|
describe('client.lIndex', () => {
|
||||||
|
testUtils.testWithClient('null', async client => {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
await client.lIndex('key', 0),
|
await client.lIndex('key', 0),
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
}, GLOBAL.SERVERS.OPEN);
|
}, 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 => {
|
testUtils.testWithCluster('cluster.lIndex', async cluster => {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
await cluster.lIndex('key', 0),
|
await cluster.lIndex('key', 0),
|
||||||
|
Reference in New Issue
Block a user