step 1 : setting konfigurasi

This commit is contained in:
sindhu
2024-07-25 09:45:02 +07:00
parent 9f972502d3
commit 84607a40db
1642 changed files with 1427528 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
'use strict';
const { expect } = require('chai');
const validate = require('../../src/pattern-validation');
describe('pattern-validation', () => {
it('should succeed with a valid expression', () => {
expect(() => {
validate('59 * * * *');
}).to.not.throw();
});
it('should fail with an invalid expression', () => {
expect(() => {
validate('60 * * * *');
}).to.throw('60 is a invalid expression for minute');
});
it('should fail without a string', () => {
expect(() => {
validate(50);
}).to.throw('pattern must be a string!');
});
});