1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00
Files
node-redis/packages/search/lib/commands/DICTADD.spec.ts

29 lines
830 B
TypeScript

import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './DICTADD';
describe('DICTADD', () => {
describe('transformArguments', () => {
it('string', () => {
assert.deepEqual(
transformArguments('dictionary', 'term'),
['FT.DICTADD', 'dictionary', 'term']
);
});
it('Array', () => {
assert.deepEqual(
transformArguments('dictionary', ['1', '2']),
['FT.DICTADD', 'dictionary', '1', '2']
);
});
});
testUtils.testWithClient('client.ft.dictAdd', async client => {
assert.equal(
await client.ft.dictAdd('dictionary', 'term'),
1
);
}, GLOBAL.SERVERS.OPEN);
});