1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-03 04:01:40 +03:00
Files
node-redis/packages/time-series/lib/commands/DELETERULE.spec.ts
Simon Prickett d602682b64 Adding a RedisTimeSeries example (#1839)
* Adds the start of a timeseries example.

* Exports required TimeSeries items.

* Fixed import.

* Added TS.INFO example output.

* Fixed typo.

* Fixed typo.

* Exported aggregation enum.

* Working time series example.

Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>
2022-01-19 13:35:18 -05:00

27 lines
860 B
TypeScript

import { strict as assert } from 'assert';
import { TimeSeriesAggregationType } from '.';
import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './DELETERULE';
describe('DELETERULE', () => {
it('transformArguments', () => {
assert.deepEqual(
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)
]);
assert.equal(
await client.ts.deleteRule('source', 'destination'),
'OK'
);
}, GLOBAL.SERVERS.OPEN);
});