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

fix DELETERULE

This commit is contained in:
dovi
2023-07-05 14:41:38 -04:00
parent ffa5c50fc0
commit a9ec9e2b9b
2 changed files with 29 additions and 26 deletions

View File

@@ -1,26 +1,26 @@
import { strict as assert } from 'assert';
import { TimeSeriesAggregationType } from '.';
import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './DELETERULE';
import DELETERULE from './DELETERULE';
describe('DELETERULE', () => {
it('transformArguments', () => {
assert.deepEqual(
transformArguments('source', 'destination'),
['TS.DELETERULE', 'source', 'destination']
);
});
it('transformArguments', () => {
assert.deepEqual(
DELETERULE.transformArguments('source', 'destination'),
['TS.DELETERULE', 'source', 'destination']
);
});
testUtils.testWithClient('client.ts.deleteRule', async client => {
await Promise.all([
client.ts.create('source'),
client.ts.create('destination'),
client.ts.createRule('source', 'destination', TimeSeriesAggregationType.AVERAGE, 1)
]);
testUtils.testWithClient('client.ts.deleteRule', async client => {
await Promise.all([
client.ts.create('source'),
client.ts.create('destination'),
client.ts.createRule('source', 'destination', TimeSeriesAggregationType.AVERAGE, 1)
]);
assert.equal(
await client.ts.deleteRule('source', 'destination'),
'OK'
);
}, GLOBAL.SERVERS.OPEN);
assert.equal(
await client.ts.deleteRule('source', 'destination'),
'OK'
);
}, GLOBAL.SERVERS.OPEN);
});