make tests run with mock client

tests now work without elasticsearch running
This commit is contained in:
2016-04-22 16:51:35 -07:00
parent a3a0c2b261
commit 3318c775c0

View File

@@ -1,10 +1,17 @@
import events from 'events'; import events from 'events';
import expect from 'expect.js'; import expect from 'expect.js';
import * as elasticsearchMock from '../fixtures/elasticsearch';
import Elastique from '../../lib/index'; import Elastique from '../../lib/index';
describe('Elastique class', function () { describe('Elastique class', function () {
let client;
beforeEach(function () {
client = new elasticsearchMock.Client();
});
it('should be an event emitter', function () { it('should be an event emitter', function () {
const queue = new Elastique('elastique'); const queue = new Elastique('elastique', { client });
expect(queue).to.be.an(events.EventEmitter); expect(queue).to.be.an(events.EventEmitter);
}); });
@@ -30,9 +37,4 @@ describe('Elastique class', function () {
expect(init).to.throwException(/invalid.+protocol/i); expect(init).to.throwException(/invalid.+protocol/i);
}); });
}); });
describe('Job Creation', function () {
});
}); });