You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-03 04:01:40 +03:00
* 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>
26 lines
866 B
TypeScript
26 lines
866 B
TypeScript
import { strict as assert } from 'assert';
|
|
import { TimeSeriesAggregationType } from '.';
|
|
import testUtils, { GLOBAL } from '../test-utils';
|
|
import { transformArguments } from './CREATERULE';
|
|
|
|
describe('CREATERULE', () => {
|
|
it('transformArguments', () => {
|
|
assert.deepEqual(
|
|
transformArguments('source', 'destination', TimeSeriesAggregationType.AVERAGE, 1),
|
|
['TS.CREATERULE', 'source', 'destination', 'AGGREGATION', 'avg', '1']
|
|
);
|
|
});
|
|
|
|
testUtils.testWithClient('client.ts.createRule', async client => {
|
|
await Promise.all([
|
|
client.ts.create('source'),
|
|
client.ts.create('destination')
|
|
]);
|
|
|
|
assert.equal(
|
|
await client.ts.createRule('source', 'destination', TimeSeriesAggregationType.AVERAGE, 1),
|
|
'OK'
|
|
);
|
|
}, GLOBAL.SERVERS.OPEN);
|
|
});
|