Test cleanup and fixes [g-h]

This commit is contained in:
Angelos Chalaris
2018-06-18 16:57:55 +03:00
parent 382c452858
commit 7e9aae6f13
26 changed files with 113 additions and 168 deletions

View File

@ -1,17 +1,15 @@
const expect = require('expect');
const geometricProgression = require('./geometricProgression.js');
test('geometricProgression is a Function', () => {
test('geometricProgression is a Function', () => {
expect(geometricProgression).toBeInstanceOf(Function);
});
test('Initializes an array containing the numbers in the specified range', () => {
expect(geometricProgression(256), [1, 2, 4, 8, 16, 32, 64, 128).toEqual(256])
test('Initializes an array containing the numbers in the specified range', () => {
expect(geometricProgression(256)).toEqual([1, 2, 4, 8, 16, 32, 64, 128, 256])
});
test('Initializes an array containing the numbers in the specified range', () => {
expect(geometricProgression(256, 3), [3, 6, 12, 24, 48, 96).toEqual(192])
test('Initializes an array containing the numbers in the specified range', () => {
expect(geometricProgression(256, 3)).toEqual([3, 6, 12, 24, 48, 96, 192])
});
test('Initializes an array containing the numbers in the specified range', () => {
expect(geometricProgression(256, 1, 4), [1, 4, 16, 64).toEqual(256])
test('Initializes an array containing the numbers in the specified range', () => {
expect(geometricProgression(256, 1, 4)).toEqual([1, 4, 16, 64, 256])
});