From 3318c775c081e02c70b7df7c4c3cb96d420b663c Mon Sep 17 00:00:00 2001 From: Joe Fleming Date: Fri, 22 Apr 2016 16:51:35 -0700 Subject: [PATCH] make tests run with mock client tests now work without elasticsearch running --- test/src/index.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/src/index.js b/test/src/index.js index 9a1f9f0..a76db71 100644 --- a/test/src/index.js +++ b/test/src/index.js @@ -1,10 +1,17 @@ import events from 'events'; import expect from 'expect.js'; +import * as elasticsearchMock from '../fixtures/elasticsearch'; import Elastique from '../../lib/index'; describe('Elastique class', function () { + let client; + + beforeEach(function () { + client = new elasticsearchMock.Client(); + }); + 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); }); @@ -30,9 +37,4 @@ describe('Elastique class', function () { expect(init).to.throwException(/invalid.+protocol/i); }); }); - - describe('Job Creation', function () { - - }); - }); \ No newline at end of file