You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-12-15 23:55:38 +03:00
fix(commands): sPopCount return Array<string> (#3006)
Also, touch the tests for spop and spopcount to use the new parseCommand API fixes #3004
This commit is contained in:
committed by
GitHub
parent
c5b4f47975
commit
742d5713e8
@@ -1,12 +1,14 @@
|
||||
import { strict as assert } from 'node:assert';
|
||||
import testUtils, { GLOBAL } from '../test-utils';
|
||||
import SPOP from './SPOP';
|
||||
import { parseArgs } from './generic-transformers';
|
||||
import { BasicCommandParser } from '../client/parser';
|
||||
|
||||
describe('SPOP', () => {
|
||||
it('transformArguments', () => {
|
||||
const parser = new BasicCommandParser();
|
||||
SPOP.parseCommand(parser, 'key');
|
||||
assert.deepEqual(
|
||||
parseArgs(SPOP, 'key'),
|
||||
parser.redisArgs,
|
||||
['SPOP', 'key']
|
||||
);
|
||||
});
|
||||
@@ -16,6 +18,19 @@ describe('SPOP', () => {
|
||||
await client.sPop('key'),
|
||||
null
|
||||
);
|
||||
|
||||
await client.sAdd('key', 'member');
|
||||
|
||||
assert.equal(
|
||||
await client.sPop('key'),
|
||||
'member'
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
await client.sPop('key'),
|
||||
null
|
||||
);
|
||||
|
||||
}, {
|
||||
client: GLOBAL.SERVERS.OPEN,
|
||||
cluster: GLOBAL.CLUSTERS.OPEN
|
||||
|
||||
Reference in New Issue
Block a user