1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00

some commands

This commit is contained in:
Leibale
2023-05-09 14:04:26 +03:00
parent a6c0d1dbb3
commit d59254e497
21 changed files with 295 additions and 235 deletions

View File

@@ -1,36 +1,36 @@
import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../test-utils';
import { RedisFlushModes } from './FLUSHALL';
import { transformArguments } from './FLUSHDB';
import FLUSHDB from './FLUSHDB';
import { REDIS_FLUSH_MODES } from './FLUSHALL';
describe('FLUSHDB', () => {
describe('transformArguments', () => {
it('default', () => {
assert.deepEqual(
transformArguments(),
['FLUSHDB']
);
});
it('ASYNC', () => {
assert.deepEqual(
transformArguments(RedisFlushModes.ASYNC),
['FLUSHDB', 'ASYNC']
);
});
it('SYNC', () => {
assert.deepEqual(
transformArguments(RedisFlushModes.SYNC),
['FLUSHDB', 'SYNC']
);
});
describe('transformArguments', () => {
it('default', () => {
assert.deepEqual(
FLUSHDB.transformArguments(),
['FLUSHDB']
);
});
testUtils.testWithClient('client.flushDb', async client => {
assert.equal(
await client.flushDb(),
'OK'
);
}, GLOBAL.SERVERS.OPEN);
it('ASYNC', () => {
assert.deepEqual(
FLUSHDB.transformArguments(REDIS_FLUSH_MODES.ASYNC),
['FLUSHDB', 'ASYNC']
);
});
it('SYNC', () => {
assert.deepEqual(
FLUSHDB.transformArguments(REDIS_FLUSH_MODES.SYNC),
['FLUSHDB', 'SYNC']
);
});
});
testUtils.testWithClient('client.flushDb', async client => {
assert.equal(
await client.flushDb(),
'OK'
);
}, GLOBAL.SERVERS.OPEN);
});