You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
* init * implement graph commands * add graph to packages table * fix ts.infoDebug * fix redisearch tests * Update INFO_DEBUG.ts * fix INFO.spec.ts * test QUERY and SLOWLOG Co-authored-by: Avital-Fine <avital.fine@redis.com>
41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
import { strict as assert } from 'assert';
|
|
import testUtils, { GLOBAL } from '../test-utils';
|
|
import { transformArguments } from './SYNUPDATE';
|
|
import { SchemaFieldTypes } from '.';
|
|
|
|
describe('SYNUPDATE', () => {
|
|
describe('transformArguments', () => {
|
|
it('single term', () => {
|
|
assert.deepEqual(
|
|
transformArguments('index', 'groupId', 'term'),
|
|
['FT.SYNUPDATE', 'index', 'groupId', 'term']
|
|
);
|
|
});
|
|
|
|
it('multiple terms', () => {
|
|
assert.deepEqual(
|
|
transformArguments('index', 'groupId', ['1', '2']),
|
|
['FT.SYNUPDATE', 'index', 'groupId', '1', '2']
|
|
);
|
|
});
|
|
|
|
it('with SKIPINITIALSCAN', () => {
|
|
assert.deepEqual(
|
|
transformArguments('index', 'groupId', 'term', { SKIPINITIALSCAN: true }),
|
|
['FT.SYNUPDATE', 'index', 'groupId', 'SKIPINITIALSCAN', 'term']
|
|
);
|
|
});
|
|
});
|
|
|
|
testUtils.testWithClient('client.ft.synUpdate', async client => {
|
|
await client.ft.create('index', {
|
|
field: SchemaFieldTypes.TEXT
|
|
});
|
|
|
|
assert.equal(
|
|
await client.ft.synUpdate('index', 'groupId', 'term'),
|
|
'OK'
|
|
);
|
|
}, GLOBAL.SERVERS.OPEN);
|
|
});
|