From 72389b65b279dd4bc751f3798059e3cfcf0fc493 Mon Sep 17 00:00:00 2001 From: Joe Fleming Date: Fri, 29 Apr 2016 17:25:44 -0700 Subject: [PATCH] add checks for version conflicts --- test/src/worker.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/src/worker.js b/test/src/worker.js index 51ccaaf..15b7575 100644 --- a/test/src/worker.js +++ b/test/src/worker.js @@ -173,6 +173,12 @@ describe('Worker class', function () { const msg = failSpy.firstCall.args[1]; expect(msg).to.equal(false); }); + + it('should swallow version mismatch errors', function () { + mockQueue.client.update.restore(); + sinon.stub(mockQueue.client, 'update').returns(Promise.reject({ statusCode: 409 })); + return worker._claimJob(job); + }); }); describe('failing a job', function () { @@ -208,6 +214,12 @@ describe('Worker class', function () { expect(doc).to.have.property('output'); expect(doc.output).to.have.property('content', msg); }); + + it('should swallow version mismatch errors', function () { + mockQueue.client.update.restore(); + sinon.stub(mockQueue.client, 'update').returns(Promise.reject({ statusCode: 409 })); + return worker._failJob(job); + }); }); });