1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-11 22:42:42 +03:00
Files
node-redis/packages/client/lib/commands/XREAD.spec.ts
Leibale Eidelman b4bb68d8ab V5 branch (#2491)
* wip

* Worked on phrasing etc for v5 doc changes.

* Removed quite repetition of 'Rather'

* Update v4-to-v5.md

* Update v4-to-v5.md

* Update v4-to-v5.md

* WIP

* WIP

* clean SET command

* some more commands, multi.exec<'typed'>

* "typed" multi

* WIP

* upgrade deps

* wip

* wip

* fix #2469

* wip

* npm update

* wip

* wip

* wip

* wip

* some tests

* tests.yml

* wip

* wip

* merge master into v5

* some more commands

* some more commands

* WIP

* Release client@2.0.0-next.1

---------

Co-authored-by: Simon Prickett <simon@redislabs.com>
2023-04-30 11:18:46 -04:00

104 lines
3.0 KiB
TypeScript

// import { strict as assert } from 'assert';
// import testUtils, { GLOBAL } from '../test-utils';
// import { FIRST_KEY_INDEX, transformArguments } from './XREAD';
// describe('XREAD', () => {
// describe('FIRST_KEY_INDEX', () => {
// it('single stream', () => {
// assert.equal(
// FIRST_KEY_INDEX({ key: 'key', id: '' }),
// 'key'
// );
// });
// it('multiple streams', () => {
// assert.equal(
// FIRST_KEY_INDEX([{ key: '1', id: '' }, { key: '2', id: '' }]),
// '1'
// );
// });
// });
// describe('transformArguments', () => {
// it('single stream', () => {
// assert.deepEqual(
// transformArguments({
// key: 'key',
// id: '0'
// }),
// ['XREAD', 'STREAMS', 'key', '0']
// );
// });
// it('multiple streams', () => {
// assert.deepEqual(
// transformArguments([{
// key: '1',
// id: '0'
// }, {
// key: '2',
// id: '0'
// }]),
// ['XREAD', 'STREAMS', '1', '2', '0', '0']
// );
// });
// it('with COUNT', () => {
// assert.deepEqual(
// transformArguments({
// key: 'key',
// id: '0'
// }, {
// COUNT: 1
// }),
// ['XREAD', 'COUNT', '1', 'STREAMS', 'key', '0']
// );
// });
// it('with BLOCK', () => {
// assert.deepEqual(
// transformArguments({
// key: 'key',
// id: '0'
// }, {
// BLOCK: 0
// }),
// ['XREAD', 'BLOCK', '0', 'STREAMS', 'key', '0']
// );
// });
// it('with COUNT, BLOCK', () => {
// assert.deepEqual(
// transformArguments({
// key: 'key',
// id: '0'
// }, {
// COUNT: 1,
// BLOCK: 0
// }),
// ['XREAD', 'COUNT', '1', 'BLOCK', '0', 'STREAMS', 'key', '0']
// );
// });
// });
// testUtils.testWithClient('client.xRead', async client => {
// assert.equal(
// await client.xRead({
// key: 'key',
// id: '0'
// }),
// null
// );
// }, GLOBAL.SERVERS.OPEN);
// testUtils.testWithCluster('cluster.xRead', async cluster => {
// assert.equal(
// await cluster.xRead({
// key: 'key',
// id: '0'
// }),
// null
// );
// }, GLOBAL.CLUSTERS.OPEN);
// });