Ghost/ghost/job-manager/test/job-manager.test.js
Naz 1b1794063f Added experimental job scheduling feature
no issue

- This method should be used with caution and should serve as a playground for upcoming new feature of scheduled jobs support
2020-11-05 17:36:29 +13:00

27 lines
776 B
JavaScript

// Switch these lines once there are useful utils
// const testUtils = require('./utils');
require('./utils');
const JobManager = new require('../index');
describe('Job Manager', function () {
it('public interface', function () {
const jobManager = new JobManager();
should.exist(jobManager.addJob);
should.exist(jobManager.scheduleJob);
});
describe('Schedule Job', function () {
it ('fails to run for invalid scheduling expression', function () {
const jobManager = new JobManager();
try {
jobManager.scheduleJob(() => {}, {}, 'invalid expression');
} catch (err) {
err.message.should.equal('Invalid schedule format');
}
});
});
});