You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
22 lines
574 B
TypeScript
22 lines
574 B
TypeScript
import { strict as assert } from 'node:assert';
|
|
import testUtils, { GLOBAL } from '../test-utils';
|
|
import TOGGLE from './TOGGLE';
|
|
|
|
describe('JSON.TOGGLE', () => {
|
|
it('transformArguments', () => {
|
|
assert.deepEqual(
|
|
TOGGLE.transformArguments('key', '$'),
|
|
['JSON.TOGGLE', 'key', '$']
|
|
);
|
|
});
|
|
|
|
testUtils.testWithClient('client.json.toggle', async client => {
|
|
const [, reply] = await Promise.all([
|
|
client.json.set('key', '$', true),
|
|
client.json.toggle('key', '$')
|
|
]);
|
|
|
|
assert.deepEqual(reply, [0]);
|
|
}, GLOBAL.SERVERS.OPEN);
|
|
});
|