haifa-reminder/node_modules/node-cron/test/convert-expression/convert-expression-test.js

19 lines
597 B
JavaScript
Raw Normal View History

2023-07-26 11:01:58 +00:00
'use strict';
const { expect } = require('chai');
const conversion = require('../../src/convert-expression');
describe('month-names-conversion.js', () => {
it('shuld convert month names', () => {
const expression = conversion('* * * * January,February *');
const expressions = expression.split(' ');
expect(expressions[4]).to.equal('1,2');
});
it('shuld convert week day names', () => {
const expression = conversion('* * * * * Mon,Sun');
const expressions = expression.split(' ');
expect(expressions[5]).to.equal('1,0');
});
});