add custom client test

This commit is contained in:
2016-06-06 14:58:54 -07:00
parent 39315dddd0
commit 5fe4e644d6

View File

@@ -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 () {