| 1 |
import { strict as assert } from 'assert'; |
| 2 |
import testUtils, { GLOBAL } from '../test-utils'; |
| 3 |
import { transformArguments } from './DICTADD'; |
| 4 |
|
| 5 |
describe('DICTADD', () => { |
| 6 |
describe('transformArguments', () => { |
| 7 |
it('string', () => { |
| 8 |
assert.deepEqual( |
| 9 |
transformArguments('dictionary', 'term'), |
| 10 |
['FT.DICTADD', 'dictionary', 'term'] |
| 11 |
); |
| 12 |
}); |
| 13 |
|
| 14 |
it('Array', () => { |
| 15 |
assert.deepEqual( |
| 16 |
transformArguments('dictionary', ['1', '2']), |
| 17 |
['FT.DICTADD', 'dictionary', '1', '2'] |
| 18 |
); |
| 19 |
}); |
| 20 |
}); |
| 21 |
|
| 22 |
testUtils.testWithClient('client.ft.dictAdd', async client => { |
| 23 |
assert.equal( |
| 24 |
await client.ft.dictAdd('dictionary', 'term'), |
| 25 |
1 |
| 26 |
); |
| 27 |
}, GLOBAL.SERVERS.OPEN); |
| 28 |
}); |