You've already forked node-redis
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:
@@ -1,30 +1,30 @@
|
||||
import { strict as assert } from 'assert';
|
||||
import testUtils, { GLOBAL } from '../test-utils';
|
||||
import { transformArguments } from './STRLEN';
|
||||
import STRLEN from './STRLEN';
|
||||
|
||||
describe('STRLEN', () => {
|
||||
describe('transformArguments', () => {
|
||||
it('without path', () => {
|
||||
assert.deepEqual(
|
||||
transformArguments('key'),
|
||||
['JSON.STRLEN', 'key']
|
||||
);
|
||||
});
|
||||
|
||||
it('with path', () => {
|
||||
assert.deepEqual(
|
||||
transformArguments('key', '$'),
|
||||
['JSON.STRLEN', 'key', '$']
|
||||
);
|
||||
});
|
||||
describe('transformArguments', () => {
|
||||
it('without path', () => {
|
||||
assert.deepEqual(
|
||||
STRLEN.transformArguments('key'),
|
||||
['JSON.STRLEN', 'key']
|
||||
);
|
||||
});
|
||||
|
||||
testUtils.testWithClient('client.json.strLen', async client => {
|
||||
await client.json.set('key', '$', '');
|
||||
it('with path', () => {
|
||||
assert.deepEqual(
|
||||
STRLEN.transformArguments('key', '$'),
|
||||
['JSON.STRLEN', 'key', '$']
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
assert.deepEqual(
|
||||
await client.json.strLen('key', '$'),
|
||||
[0]
|
||||
);
|
||||
}, GLOBAL.SERVERS.OPEN);
|
||||
testUtils.testWithClient('client.json.strLen', async client => {
|
||||
await client.json.set('key', '$', '');
|
||||
|
||||
assert.deepEqual(
|
||||
await client.json.strLen('key', '$'),
|
||||
[0]
|
||||
);
|
||||
}, GLOBAL.SERVERS.OPEN);
|
||||
});
|
||||
|
Reference in New Issue
Block a user