Additional tests

This commit is contained in:
Angelos Chalaris
2018-11-01 14:35:17 +02:00
parent e861766bd5
commit a097c3de36
3 changed files with 28 additions and 0 deletions

View File

@ -4,3 +4,12 @@ const {initializeArrayWithRangeRight} = require('./_30s.js');
test('initializeArrayWithRangeRight is a Function', () => {
expect(initializeArrayWithRangeRight).toBeInstanceOf(Function);
});
test('Initializes an array containing the numbers in the specified range (witout start value)', () => {
expect(initializeArrayWithRangeRight(5)).toEqual([5, 4, 3, 2, 1, 0]);
});
test('Initializes an array containing the numbers in the specified range', () => {
expect(initializeArrayWithRangeRight(7, 3)).toEqual([7, 6, 5, 4, 3]);
});
test('Initializes an array containing the numbers in the specified range (with step)', () => {
expect(initializeArrayWithRangeRight(9, 0, 2)).toEqual([8, 6, 4, 2, 0]);
});