empty_around_comma.js 518 B

12345678910111213141516171819202122
  1. // empty around comma
  2. var test = require('tap').test;
  3. var CronExpression = require('../lib/expression');
  4. const options = {
  5. utc: true
  6. };
  7. test('both empty around comma', function (t) {
  8. t.throws(function () {
  9. CronExpression.parse('*/10 * * * * ,', options);
  10. }, new Error('Invalid list value format'));
  11. t.end();
  12. });
  13. test('one side empty around comma', function (t) {
  14. t.throws(function () {
  15. CronExpression.parse('*/10 * * * * ,2', options);
  16. }, new Error('Invalid list value format'));
  17. t.end();
  18. });