| 1 |
import { strict as assert } from 'assert'; |
| 2 |
import { TimeSeriesAggregationType } from '.'; |
| 3 |
import testUtils, { GLOBAL } from '../test-utils'; |
| 4 |
import { transformArguments } from './DELETERULE'; |
| 5 |
|
| 6 |
describe('DELETERULE', () => { |
| 7 |
it('transformArguments', () => { |
| 8 |
assert.deepEqual( |
| 9 |
transformArguments('source', 'destination'), |
| 10 |
['TS.DELETERULE', 'source', 'destination'] |
| 11 |
); |
| 12 |
}); |
| 13 |
|
| 14 |
testUtils.testWithClient('client.ts.deleteRule', async client => { |
| 15 |
await Promise.all([ |
| 16 |
client.ts.create('source'), |
| 17 |
client.ts.create('destination'), |
| 18 |
client.ts.createRule('source', 'destination', TimeSeriesAggregationType.AVERAGE, 1) |
| 19 |
]); |
| 20 |
|
| 21 |
assert.equal( |
| 22 |
await client.ts.deleteRule('source', 'destination'), |
| 23 |
'OK' |
| 24 |
); |
| 25 |
}, GLOBAL.SERVERS.OPEN); |
| 26 |
}); |