You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
stream commands + some more
This commit is contained in:
@@ -1,30 +1,39 @@
|
||||
// import { strict as assert } from 'assert';
|
||||
// import testUtils, { GLOBAL } from '../test-utils';
|
||||
// import { transformArguments } from './XREVRANGE';
|
||||
import { strict as assert } from 'assert';
|
||||
import testUtils, { GLOBAL } from '../test-utils';
|
||||
import XREVRANGE from './XREVRANGE';
|
||||
|
||||
// describe('XREVRANGE', () => {
|
||||
// describe('transformArguments', () => {
|
||||
// it('simple', () => {
|
||||
// assert.deepEqual(
|
||||
// transformArguments('key', '-', '+'),
|
||||
// ['XREVRANGE', 'key', '-', '+']
|
||||
// );
|
||||
// });
|
||||
describe('XREVRANGE', () => {
|
||||
describe('transformArguments', () => {
|
||||
it('simple', () => {
|
||||
assert.deepEqual(
|
||||
XREVRANGE.transformArguments('key', '-', '+'),
|
||||
['XREVRANGE', 'key', '-', '+']
|
||||
);
|
||||
});
|
||||
|
||||
// it('with COUNT', () => {
|
||||
// assert.deepEqual(
|
||||
// transformArguments('key', '-', '+', {
|
||||
// COUNT: 1
|
||||
// }),
|
||||
// ['XREVRANGE', 'key', '-', '+', 'COUNT', '1']
|
||||
// );
|
||||
// });
|
||||
// });
|
||||
it('with COUNT', () => {
|
||||
assert.deepEqual(
|
||||
XREVRANGE.transformArguments('key', '-', '+', {
|
||||
COUNT: 1
|
||||
}),
|
||||
['XREVRANGE', 'key', '-', '+', 'COUNT', '1']
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
// testUtils.testWithClient('client.xRevRange', async client => {
|
||||
// assert.deepEqual(
|
||||
// await client.xRevRange('key', '+', '-'),
|
||||
// []
|
||||
// );
|
||||
// }, GLOBAL.SERVERS.OPEN);
|
||||
// });
|
||||
testUtils.testAll('xRevRange', async client => {
|
||||
const message = { field: 'value' },
|
||||
[id, reply] = await Promise.all([
|
||||
client.xAdd('key', '*', message),
|
||||
client.xRevRange('key', '-', '+')
|
||||
]);
|
||||
|
||||
assert.deepEqual(reply, [{
|
||||
id,
|
||||
message
|
||||
}]);
|
||||
}, {
|
||||
client: GLOBAL.SERVERS.OPEN,
|
||||
cluster: GLOBAL.CLUSTERS.OPEN
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user