mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
58bc922c0e
refs c0cecd71fe
20 lines
766 B
JavaScript
20 lines
766 B
JavaScript
// Switch these lines once there are useful utils
|
|
// const testUtils = require('./utils');
|
|
require('./utils');
|
|
|
|
const isCronExpression = require('../lib/is-cron-expression');
|
|
|
|
describe('Is cron expression', function () {
|
|
it('valid cron expressions', function () {
|
|
should(isCronExpression('* * * * * *')).be.true();
|
|
should(isCronExpression('1 * * * * *')).be.true();
|
|
should(isCronExpression('0 0 13-23 * * *'), 'Range should be 0-23').be.true();
|
|
});
|
|
|
|
it('invalid cron expressions', function () {
|
|
should(isCronExpression('0 123 * * * *')).not.be.true();
|
|
should(isCronExpression('a * * * *')).not.be.true();
|
|
should(isCronExpression('* 13-24 * * *'), 'Invalid range should be 0-23').not.be.true();
|
|
});
|
|
});
|