You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
49 lines
1.3 KiB
TypeScript
49 lines
1.3 KiB
TypeScript
import { strict as assert } from 'assert';
|
|
import testUtils, { GLOBAL } from '../test-utils';
|
|
import { transformArguments } from './PUBSUB_SHARDNUMSUB';
|
|
|
|
describe('PUBSUB SHARDNUMSUB', () => {
|
|
testUtils.isVersionGreaterThanHook([7]);
|
|
|
|
describe('transformArguments', () => {
|
|
it('simple', () => {
|
|
assert.deepEqual(
|
|
transformArguments(),
|
|
['PUBSUB', 'SHARDNUMSUB']
|
|
);
|
|
});
|
|
|
|
it('string', () => {
|
|
assert.deepEqual(
|
|
transformArguments('channel'),
|
|
['PUBSUB', 'SHARDNUMSUB', 'channel']
|
|
);
|
|
});
|
|
|
|
it('array', () => {
|
|
assert.deepEqual(
|
|
transformArguments(['1', '2']),
|
|
['PUBSUB', 'SHARDNUMSUB', '1', '2']
|
|
);
|
|
});
|
|
});
|
|
|
|
testUtils.testWithClient('client.pubSubShardNumSub', async client => {
|
|
assert.deepEqual(
|
|
await client.pubSubShardNumSub(['foo', 'bar']),
|
|
Object.create(null, {
|
|
foo: {
|
|
value: 0,
|
|
configurable: true,
|
|
enumerable: true
|
|
},
|
|
bar: {
|
|
value: 0,
|
|
configurable: true,
|
|
enumerable: true
|
|
}
|
|
})
|
|
);
|
|
}, GLOBAL.SERVERS.OPEN);
|
|
});
|