You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
27 lines
726 B
TypeScript
27 lines
726 B
TypeScript
import { strict as assert } from 'assert';
|
|
import testUtils, { GLOBAL } from '../test-utils';
|
|
import { transformArguments } from './SETNX';
|
|
|
|
describe('SETNX', () => {
|
|
it('transformArguments', () => {
|
|
assert.deepEqual(
|
|
transformArguments('key', 'value'),
|
|
['SETNX', 'key', 'value']
|
|
);
|
|
});
|
|
|
|
testUtils.testWithClient('client.setNX', async client => {
|
|
assert.equal(
|
|
await client.setNX('key', 'value'),
|
|
true
|
|
);
|
|
}, GLOBAL.SERVERS.OPEN);
|
|
|
|
testUtils.testWithCluster('cluster.setNX', async cluster => {
|
|
assert.equal(
|
|
await cluster.setNX('key', 'value'),
|
|
true
|
|
);
|
|
}, GLOBAL.CLUSTERS.OPEN);
|
|
});
|