From 39315dddd0adae08d2013b48dfdf710735a931ef Mon Sep 17 00:00:00 2001 From: Joe Fleming Date: Mon, 6 Jun 2016 14:58:48 -0700 Subject: [PATCH] add internal properties test --- test/src/worker.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/src/worker.js b/test/src/worker.js index 2dde223..ff69800 100644 --- a/test/src/worker.js +++ b/test/src/worker.js @@ -51,6 +51,20 @@ describe('Worker class', function () { }); describe('construction', function () { + it('should assign internal properties', function () { + const jobtype = 'testjob'; + const workerFn = noop; + const worker = new Worker(mockQueue, jobtype, workerFn); + expect(worker).to.have.property('id'); + expect(worker).to.have.property('queue', mockQueue); + expect(worker).to.have.property('client', client); + expect(worker).to.have.property('jobtype', jobtype); + expect(worker).to.have.property('workerFn', workerFn); + expect(worker).to.have.property('checkInterval'); + expect(worker).to.have.property('checkSize'); + expect(worker).to.have.property('doctype'); + }); + it('should have a unique ID', function () { const worker = new Worker(mockQueue, 'test', noop); expect(worker.id).to.be.a('string');