From 47eaebf8c6fa66421f6fd5a117cd761f43fe1ffd Mon Sep 17 00:00:00 2001 From: Joe Fleming Date: Fri, 22 Apr 2016 17:03:23 -0700 Subject: [PATCH] test for ping call on new queue --- test/src/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/src/index.js b/test/src/index.js index a76db71..c006ecd 100644 --- a/test/src/index.js +++ b/test/src/index.js @@ -1,5 +1,6 @@ import events from 'events'; import expect from 'expect.js'; +import sinon from 'sinon'; import * as elasticsearchMock from '../fixtures/elasticsearch'; import Elastique from '../../lib/index'; @@ -37,4 +38,13 @@ describe('Elastique class', function () { expect(init).to.throwException(/invalid.+protocol/i); }); }); + + describe('Queue construction', function () { + it('should ping the ES server', function () { + const pingSpy = sinon.spy(client, 'ping'); + new Elastique('elastique', { client }); + sinon.assert.calledOnce(pingSpy); + }); + }); + }); \ No newline at end of file