You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
40 lines
959 B
TypeScript
40 lines
959 B
TypeScript
import { strict as assert } from 'assert';
|
|
import testUtils, { GLOBAL } from '../test-utils';
|
|
import XREVRANGE from './XREVRANGE';
|
|
|
|
describe('XREVRANGE', () => {
|
|
describe('transformArguments', () => {
|
|
it('simple', () => {
|
|
assert.deepEqual(
|
|
XREVRANGE.transformArguments('key', '-', '+'),
|
|
['XREVRANGE', 'key', '-', '+']
|
|
);
|
|
});
|
|
|
|
it('with COUNT', () => {
|
|
assert.deepEqual(
|
|
XREVRANGE.transformArguments('key', '-', '+', {
|
|
COUNT: 1
|
|
}),
|
|
['XREVRANGE', 'key', '-', '+', 'COUNT', '1']
|
|
);
|
|
});
|
|
});
|
|
|
|
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
|
|
});
|
|
});
|