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 returnBuffers
, add some tests
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { strict as assert } from 'assert';
|
||||
import testUtils, { GLOBAL } from '../../test-utils';
|
||||
import { transformArguments } from './LOADCHUNK';
|
||||
|
||||
describe('CF LOADCHUNK', () => {
|
||||
@@ -8,4 +9,23 @@ describe('CF LOADCHUNK', () => {
|
||||
['CF.LOADCHUNK', 'item', '0', '']
|
||||
);
|
||||
});
|
||||
|
||||
testUtils.testWithClient('client.cf.loadChunk', async client => {
|
||||
const [,, { iterator, chunk }] = await Promise.all([
|
||||
client.cf.reserve('source', 4),
|
||||
client.cf.add('source', 'item'),
|
||||
client.cf.scanDump(
|
||||
client.commandOptions({ returnBuffers: true }),
|
||||
'source',
|
||||
0
|
||||
)
|
||||
]);
|
||||
|
||||
assert.ok(Buffer.isBuffer(chunk));
|
||||
|
||||
assert.equal(
|
||||
await client.cf.loadChunk('destination', iterator, chunk),
|
||||
'OK'
|
||||
);
|
||||
}, GLOBAL.SERVERS.OPEN);
|
||||
});
|
||||
|
Reference in New Issue
Block a user