You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
fix #1802
This commit is contained in:
@@ -26,12 +26,32 @@ describe('ARRPOP', () => {
|
||||
});
|
||||
});
|
||||
|
||||
testUtils.testWithClient('client.json.arrPop', async client => {
|
||||
await client.json.set('key', '$', []);
|
||||
describe('client.json.arrPop', () => {
|
||||
testUtils.testWithClient('null', async client => {
|
||||
await client.json.set('key', '.', []);
|
||||
|
||||
assert.deepEqual(
|
||||
await client.json.arrPop('key', '$'),
|
||||
[null]
|
||||
);
|
||||
}, GLOBAL.SERVERS.OPEN);
|
||||
assert.equal(
|
||||
await client.json.arrPop('key', '.'),
|
||||
null
|
||||
);
|
||||
}, GLOBAL.SERVERS.OPEN);
|
||||
|
||||
testUtils.testWithClient('with value', async client => {
|
||||
await client.json.set('key', '.', ['value']);
|
||||
|
||||
assert.equal(
|
||||
await client.json.arrPop('key', '.'),
|
||||
'value'
|
||||
);
|
||||
}, GLOBAL.SERVERS.OPEN);
|
||||
|
||||
testUtils.testWithClient('array', async client => {
|
||||
await client.json.set('key', '$', ['value']);
|
||||
|
||||
assert.deepEqual(
|
||||
await client.json.arrPop('key', '$'),
|
||||
['value']
|
||||
);
|
||||
}, GLOBAL.SERVERS.OPEN);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user