add job creation error

use it on creation error, update tests
This commit is contained in:
2016-07-11 16:03:59 -07:00
parent c758fb55a6
commit bfe8799b90
3 changed files with 5 additions and 5 deletions

View File

@@ -133,7 +133,7 @@ describe('Job Class', function () {
createIndexMock.returns(Promise.reject(new Error(errMsg)));
const job = new Job(mockQueue, index, type, payload);
job.once(contstants.EVENT_JOB_ERROR, (err) => {
job.once(contstants.EVENT_JOB_CREATE_ERROR, (err) => {
try {
expect(err.message).to.equal(errMsg);
done();
@@ -150,7 +150,7 @@ describe('Job Class', function () {
sinon.stub(client, 'index', () => Promise.reject(new Error(errMsg)));
const job = new Job(mockQueue, index, type, payload);
job.once(contstants.EVENT_JOB_ERROR, (err) => {
job.once(contstants.EVENT_JOB_CREATE_ERROR, (err) => {
try {
expect(err.message).to.equal(errMsg);
done();