add job creation error
use it on creation error, update tests
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user