1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00
Files
node-redis/packages/bloom/lib/commands/bloom/LOADCHUNK.spec.ts
2023-07-05 15:22:33 -04:00

36 lines
914 B
TypeScript

import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../../test-utils';
import LOADCHUNK from './LOADCHUNK';
import { RESP_TYPES } from '@redis/client';
describe('BF.LOADCHUNK', () => {
it('transformArguments', () => {
assert.deepEqual(
LOADCHUNK.transformArguments('key', 0, ''),
['BF.LOADCHUNK', 'key', '0', '']
);
});
testUtils.testWithClient('client.bf.loadChunk', async client => {
const [, { iterator, chunk }] = await Promise.all([
client.bf.reserve('source', 0.01, 100),
client.bf.scanDump('source', 0)
]);
assert.equal(
await client.bf.loadChunk('destination', iterator, chunk),
'OK'
);
}, {
...GLOBAL.SERVERS.OPEN,
clientOptions: {
...GLOBAL.SERVERS.OPEN.clientOptions,
commandOptions: {
typeMapping: {
[RESP_TYPES.BLOB_STRING]: Buffer
}
}
}
});
});