add queue tests for job creation

This commit is contained in:
2016-07-12 13:22:40 -07:00
parent 775442f284
commit f8db6e1bd3
3 changed files with 83 additions and 1 deletions

17
test/fixtures/job.js vendored Normal file
View File

@@ -0,0 +1,17 @@
import events from 'events';
export default class Job extends events.EventEmitter {
constructor(queue, index, type, payload, options = {}) {
super();
this.queue = queue;
this.index = index;
this.jobType = type;
this.payload = payload;
this.options = options;
}
getProp(name) {
return this[name];
}
}

16
test/fixtures/worker.js vendored Normal file
View File

@@ -0,0 +1,16 @@
import events from 'events';
export default class Worker extends events.EventEmitter {
constructor(queue, type, workerFn, opts = {}) {
super();
this.queue = queue;
this.type = type;
this.workerFn = workerFn;
this.options = opts;
}
getProp(name) {
return this[name];
}
}