ensure objects are event emitters

This commit is contained in:
2016-04-15 17:29:40 -07:00
parent 9f495c7791
commit 5ce288fd72
2 changed files with 14 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
import events from 'events';
import expect from 'expect.js';
import sinon from 'sinon';
import Job from '../../lib/job';
@@ -12,7 +13,12 @@ describe('Jobs', function () {
};
});
describe('invlaid construction', function () {
it('should be an event emitter', function () {
const job = new Job(mockQueue, 'test', {});
expect(job).to.be.an(events.EventEmitter);
});
describe('invalid construction', function () {
it('should throw with a missing type', function () {
const init = () => new Job(mockQueue);
expect(init).to.throwException(/type.+string/i);