Skip to content

Commit eb29a2b

Browse files
committed
[jobs] Removing should from test job
1 parent c876337 commit eb29a2b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

api/jobs/test.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
/* jshint ignore:start */
44

5-
const should = require('should'),
6-
J = require('../parts/jobs/job.js'),
5+
const J = require('../parts/jobs/job.js'),
76
R = require('../parts/jobs/resource.js'),
87
RET = require('../parts/jobs/retry.js');
98

@@ -107,8 +106,12 @@ class IPCTestJob extends J.IPCJob {
107106
*/
108107
async run(db) {
109108
console.log('running in %d', process.pid);
110-
should.exist(this.resource);
111-
(this.resource instanceof TestResource).should.be.true();
109+
if (!this.resource) {
110+
throw new Error('Resource should exist');
111+
}
112+
if (!(this.resource instanceof TestResource)) {
113+
throw new Error('Resource should be TestResource');
114+
}
112115
await new Promise((res, rej) => db.collection('jobs').updateOne({_id: this._id}, {$set: {'data.run': 1}}, err => err ? rej(err) : res()));
113116

114117
if (this.data && this.data.fail) {

0 commit comments

Comments
 (0)