You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-03 04:01:40 +03:00
38 lines
895 B
TypeScript
38 lines
895 B
TypeScript
import { strict as assert } from 'node:assert';
|
|
import testUtils, { GLOBAL } from '../test-utils';
|
|
import GET from './GET';
|
|
|
|
describe('JSON.GET', () => {
|
|
describe('transformArguments', () => {
|
|
it('simple', () => {
|
|
assert.deepEqual(
|
|
GET.transformArguments('key'),
|
|
['JSON.GET', 'key']
|
|
);
|
|
});
|
|
|
|
describe('with path', () => {
|
|
it('string', () => {
|
|
assert.deepEqual(
|
|
GET.transformArguments('key', { path: '$' }),
|
|
['JSON.GET', 'key', '$']
|
|
);
|
|
});
|
|
|
|
it('array', () => {
|
|
assert.deepEqual(
|
|
GET.transformArguments('key', { path: ['$.1', '$.2'] }),
|
|
['JSON.GET', 'key', '$.1', '$.2']
|
|
);
|
|
});
|
|
});
|
|
});
|
|
|
|
testUtils.testWithClient('client.json.get', async client => {
|
|
assert.equal(
|
|
await client.json.get('key'),
|
|
null
|
|
);
|
|
}, GLOBAL.SERVERS.OPEN);
|
|
});
|