Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

validate-minute-test.js 885B

1234567891011121314151617181920212223242526272829303132
  1. 'use strict';
  2. const { expect } = require('chai');
  3. const validate = require('../../src/pattern-validation');
  4. describe('pattern-validation.js', () => {
  5. describe('validate minutes', () => {
  6. it('should fail with invalid minute', () => {
  7. expect(() => {
  8. validate('63 * * * *');
  9. }).to.throw('63 is a invalid expression for minute');
  10. });
  11. it('should not fail with valid minute', () => {
  12. expect(() => {
  13. validate('30 * * * *');
  14. }).to.not.throw();
  15. });
  16. it('should not fail with *', () => {
  17. expect(() => {
  18. validate('* * * * *');
  19. }).to.not.throw();
  20. });
  21. it('should not fail with */2', () => {
  22. expect(() => {
  23. validate('*/2 * * * *');
  24. }).to.not.throw();
  25. });
  26. });
  27. });