1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

JSON commands

This commit is contained in:
dovi
2023-07-10 16:46:57 -04:00
parent 306fa6024d
commit 75fc5a92d1
14 changed files with 229 additions and 175 deletions

View File

@@ -1,30 +1,30 @@
import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './STRAPPEND';
// import { strict as assert } from 'assert';
// import testUtils, { GLOBAL } from '../test-utils';
// import { transformArguments } from './STRAPPEND';
describe('STRAPPEND', () => {
describe('transformArguments', () => {
it('without path', () => {
assert.deepEqual(
transformArguments('key', 'append'),
['JSON.STRAPPEND', 'key', '"append"']
);
});
// describe('STRAPPEND', () => {
// describe('transformArguments', () => {
// it('without path', () => {
// assert.deepEqual(
// transformArguments('key', 'append'),
// ['JSON.STRAPPEND', 'key', '"append"']
// );
// });
it('with path', () => {
assert.deepEqual(
transformArguments('key', '$', 'append'),
['JSON.STRAPPEND', 'key', '$', '"append"']
);
});
});
// it('with path', () => {
// assert.deepEqual(
// transformArguments('key', '$', 'append'),
// ['JSON.STRAPPEND', 'key', '$', '"append"']
// );
// });
// });
testUtils.testWithClient('client.json.strAppend', async client => {
await client.json.set('key', '$', '');
// testUtils.testWithClient('client.json.strAppend', async client => {
// await client.json.set('key', '$', '');
assert.deepEqual(
await client.json.strAppend('key', '$', 'append'),
[6]
);
}, GLOBAL.SERVERS.OPEN);
});
// assert.deepEqual(
// await client.json.strAppend('key', '$', 'append'),
// [6]
// );
// }, GLOBAL.SERVERS.OPEN);
// });