change test structure, create elasticsearch fixture
This commit is contained in:
32
test/src/index.js
Normal file
32
test/src/index.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import Elastique from '../../lib/index';
|
||||
import expect from 'expect.js';
|
||||
|
||||
describe('Elastique class', function () {
|
||||
describe('Option validation', function () {
|
||||
it('should throw without an index', function () {
|
||||
const init = () => new Elastique();
|
||||
expect(init).to.throwException(/must.+specify.+index/i);
|
||||
});
|
||||
|
||||
it('should throw with an invalid host', function () {
|
||||
const init = () => new Elastique('elastique', {
|
||||
client: { host: 'nope://nope' }
|
||||
});
|
||||
|
||||
expect(init).to.throwException(/invalid.+protocol/i);
|
||||
});
|
||||
|
||||
it('should throw with invalid hosts', function () {
|
||||
const init = () => new Elastique('elastique', {
|
||||
client: { hosts: [{ host: 'localhost', protocol: 'nope' }] }
|
||||
});
|
||||
|
||||
expect(init).to.throwException(/invalid.+protocol/i);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Job Creation', function () {
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user