You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-10 11:43:01 +03:00
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import { strict as assert } from 'assert';
|
|
import { TestRedisServers, itWithClient, TestRedisClusters, itWithCluster } from '../test-utils';
|
|
import { transformArguments } from './PUBSUB_NUMSUB';
|
|
|
|
describe('PUBSUB NUMSUB', () => {
|
|
describe('transformArguments', () => {
|
|
it('simple', () => {
|
|
assert.deepEqual(
|
|
transformArguments(),
|
|
['PUBSUB', 'NUMSUB']
|
|
);
|
|
});
|
|
|
|
it('string', () => {
|
|
assert.deepEqual(
|
|
transformArguments('channel'),
|
|
['PUBSUB', 'NUMSUB', 'channel']
|
|
);
|
|
});
|
|
|
|
it('array', () => {
|
|
assert.deepEqual(
|
|
transformArguments(['1', '2']),
|
|
['PUBSUB', 'NUMSUB', '1', '2']
|
|
);
|
|
});
|
|
});
|
|
|
|
itWithClient(TestRedisServers.OPEN, 'client.pubSubNumSub', async client => {
|
|
assert.deepEqual(
|
|
await client.pubSubNumSub(),
|
|
Object.create(null)
|
|
);
|
|
});
|
|
|
|
itWithCluster(TestRedisClusters.OPEN, 'cluster.pubSubNumSub', async cluster => {
|
|
assert.deepEqual(
|
|
await cluster.pubSubNumSub(),
|
|
Object.create(null)
|
|
);
|
|
});
|
|
});
|