Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ZimGil committed May 18, 2020
1 parent d740612 commit e3824de
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/convert-expression/step-values-conversion-test.js
Expand Up @@ -4,10 +4,16 @@ const { expect } = require('chai');
var conversion = require('../../src/convert-expression/step-values-conversion');

describe('step-values-conversion.js', () => {
it('shuld convert step values', () => {
it('should convert step values', () => {
var expressions = '1,2,3,4,5,6,7,8,9,10/2 0,1,2,3,4,5,6,7,8,9/5 * * * *'.split(' ');
expressions = conversion(expressions);
expect(expressions[0]).to.equal('2,4,6,8,10');
expect(expressions[1]).to.equal('0,5');
});

it('should throw an error if step value is not a number', () => {
var expressions = '1,2,3,4,5,6,7,8,9,10/someString 0,1,2,3,4,5,6,7,8,9/5 * * * *'.split(' ');
expect(() => conversion(expressions)).to.throw('someString is not a valid step value');
});

});

0 comments on commit e3824de

Please sign in to comment.