| 1 |
import { strict as assert } from 'assert'; |
| 2 |
import testUtils, { GLOBAL } from '../test-utils'; |
| 3 |
import { SchemaFieldTypes } from '.'; |
| 4 |
import { transformArguments } from './DROPINDEX'; |
| 5 |
|
| 6 |
describe('DROPINDEX', () => { |
| 7 |
describe('transformArguments', () => { |
| 8 |
it('without options', () => { |
| 9 |
assert.deepEqual( |
| 10 |
transformArguments('index'), |
| 11 |
['FT.DROPINDEX', 'index'] |
| 12 |
); |
| 13 |
}); |
| 14 |
|
| 15 |
it('with DD', () => { |
| 16 |
assert.deepEqual( |
| 17 |
transformArguments('index', { DD: true }), |
| 18 |
['FT.DROPINDEX', 'index', 'DD'] |
| 19 |
); |
| 20 |
}); |
| 21 |
}); |
| 22 |
|
| 23 |
testUtils.testWithClient('client.ft.dropIndex', async client => { |
| 24 |
await client.ft.create('index', { |
| 25 |
field: SchemaFieldTypes.TEXT |
| 26 |
}); |
| 27 |
|
| 28 |
assert.equal( |
| 29 |
await client.ft.dropIndex('index'), |
| 30 |
'OK' |
| 31 |
); |
| 32 |
}, GLOBAL.SERVERS.OPEN); |
| 33 |
}); |