Test cleanup and fixes [m-n]

This commit is contained in:
Angelos Chalaris
2018-06-18 17:40:29 +03:00
parent 71d768320b
commit 9f95330528
20 changed files with 102 additions and 153 deletions

View File

@ -1,14 +1,12 @@
const expect = require('expect');
const nthElement = require('./nthElement.js');
test('nthElement is a Function', () => {
test('nthElement is a Function', () => {
expect(nthElement).toBeInstanceOf(Function);
});
test('Returns the nth element of an array.', () => {
expect(nthElement(['a', 'b', 'c'], 1)).toBe('b')
test('Returns the nth element of an array.', () => {
expect(nthElement(['a', 'b', 'c'], 1)).toBe('b');
});
test('Returns the nth element of an array.', () => {
expect(nthElement(['a', 'b', 'c'], -3)).toBe('a')
test('Returns the nth element of an array.', () => {
expect(nthElement(['a', 'b', 'c'], -3)).toBe('a');
});