You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
fix #1650 - add support for Buffer in some commands, add GET_BUFFER command
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { strict as assert } from 'assert';
|
||||
import RedisMultiCommand from './multi-command';
|
||||
import { encodeCommand } from './commander';
|
||||
import { WatchError } from './errors';
|
||||
import { spy } from 'sinon';
|
||||
import { SQUARE_SCRIPT } from './client.spec';
|
||||
@@ -10,11 +9,11 @@ describe('Multi Command', () => {
|
||||
it('simple', async () => {
|
||||
const multi = RedisMultiCommand.create((queue, symbol) => {
|
||||
assert.deepEqual(
|
||||
queue.map(({encodedCommand}) => encodedCommand),
|
||||
queue.map(({ args }) => args),
|
||||
[
|
||||
encodeCommand(['MULTI']),
|
||||
encodeCommand(['PING']),
|
||||
encodeCommand(['EXEC']),
|
||||
['MULTI'],
|
||||
['PING'],
|
||||
['EXEC'],
|
||||
]
|
||||
);
|
||||
|
||||
@@ -55,8 +54,8 @@ describe('Multi Command', () => {
|
||||
it('execAsPipeline', async () => {
|
||||
const multi = RedisMultiCommand.create(queue => {
|
||||
assert.deepEqual(
|
||||
queue.map(({encodedCommand}) => encodedCommand),
|
||||
[encodeCommand(['PING'])]
|
||||
queue.map(({ args }) => args),
|
||||
[['PING']]
|
||||
);
|
||||
|
||||
return Promise.resolve(['PONG']);
|
||||
@@ -75,8 +74,8 @@ describe('Multi Command', () => {
|
||||
it('simple', async () => {
|
||||
const multi = RedisMultiCommand.create(queue => {
|
||||
assert.deepEqual(
|
||||
queue.map(({encodedCommand}) => encodedCommand),
|
||||
[encodeCommand(['PING'])]
|
||||
queue.map(({ args }) => args),
|
||||
[['PING']]
|
||||
);
|
||||
|
||||
return Promise.resolve(['PONG']);
|
||||
@@ -111,10 +110,10 @@ describe('Multi Command', () => {
|
||||
assert.deepEqual(
|
||||
await new MultiWithScript(queue => {
|
||||
assert.deepEqual(
|
||||
queue.map(({encodedCommand}) => encodedCommand),
|
||||
queue.map(({ args }) => args),
|
||||
[
|
||||
encodeCommand(['EVAL', SQUARE_SCRIPT.SCRIPT, '0', '2']),
|
||||
encodeCommand(['EVALSHA', SQUARE_SCRIPT.SHA1, '0', '3']),
|
||||
['EVAL', SQUARE_SCRIPT.SCRIPT, '0', '2'],
|
||||
['EVALSHA', SQUARE_SCRIPT.SHA1, '0', '3'],
|
||||
]
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user