You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-10 11:43:01 +03:00
V5 bringing RESP3, Sentinel and TypeMapping to node-redis
RESP3 Support - Some commands responses in RESP3 aren't stable yet and therefore return an "untyped" ReplyUnion. Sentinel TypeMapping Correctly types Multi commands Note: some API changes to be further documented in v4-to-v5.md
This commit is contained in:
@@ -1,33 +1,32 @@
|
||||
import { strict as assert } from 'assert';
|
||||
import { SchemaFieldTypes } from '.';
|
||||
import { strict as assert } from 'node:assert';
|
||||
import testUtils, { GLOBAL } from '../test-utils';
|
||||
import { transformArguments } from './CURSOR_DEL';
|
||||
import CURSOR_DEL from './CURSOR_DEL';
|
||||
import { SCHEMA_FIELD_TYPE } from './CREATE';
|
||||
|
||||
describe('CURSOR DEL', () => {
|
||||
it('transformArguments', () => {
|
||||
assert.deepEqual(
|
||||
transformArguments('index', 0),
|
||||
['FT.CURSOR', 'DEL', 'index', '0']
|
||||
);
|
||||
});
|
||||
describe('FT.CURSOR DEL', () => {
|
||||
it('transformArguments', () => {
|
||||
assert.deepEqual(
|
||||
CURSOR_DEL.transformArguments('index', 0),
|
||||
['FT.CURSOR', 'DEL', 'index', '0']
|
||||
);
|
||||
});
|
||||
|
||||
testUtils.testWithClient('client.ft.cursorDel', async client => {
|
||||
const [ ,, { cursor } ] = await Promise.all([
|
||||
client.ft.create('idx', {
|
||||
field: {
|
||||
type: SchemaFieldTypes.TEXT
|
||||
}
|
||||
}),
|
||||
client.hSet('key', 'field', 'value'),
|
||||
client.ft.aggregateWithCursor('idx', '*', {
|
||||
COUNT: 1
|
||||
})
|
||||
]);
|
||||
testUtils.testWithClient('client.ft.cursorDel', async client => {
|
||||
const [, , { cursor }] = await Promise.all([
|
||||
client.ft.create('idx', {
|
||||
field: {
|
||||
type: SCHEMA_FIELD_TYPE.TEXT
|
||||
}
|
||||
}),
|
||||
client.hSet('key', 'field', 'value'),
|
||||
client.ft.aggregateWithCursor('idx', '*', {
|
||||
COUNT: 1
|
||||
})
|
||||
]);
|
||||
|
||||
|
||||
assert.equal(
|
||||
await client.ft.cursorDel('idx', cursor),
|
||||
'OK'
|
||||
);
|
||||
}, GLOBAL.SERVERS.OPEN);
|
||||
assert.equal(
|
||||
await client.ft.cursorDel('idx', cursor),
|
||||
'OK'
|
||||
);
|
||||
}, GLOBAL.SERVERS.OPEN);
|
||||
});
|
||||
|
Reference in New Issue
Block a user