From 5fe4e644d68c38a7970d5afee08a4abd8663052f Mon Sep 17 00:00:00 2001 From: Joe Fleming Date: Mon, 6 Jun 2016 14:58:54 -0700 Subject: [PATCH] add custom client test --- test/src/worker.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/src/worker.js b/test/src/worker.js index ff69800..e18bc80 100644 --- a/test/src/worker.js +++ b/test/src/worker.js @@ -74,6 +74,14 @@ describe('Worker class', function () { expect(worker.id).to.not.equal(worker2.id); }); + + it('should use custom client', function () { + const newClient = new elasticsearchMock.Client(); + const worker = new Worker(mockQueue, 'test', noop, { client: newClient }); + expect(worker).to.have.property('queue', mockQueue); + expect(worker).to.have.property('client', newClient); + expect(worker.client).to.not.equal(client); + }); }); describe('output formatting', function () {