Files
30-seconds-of-code/test/nthElement/nthElement.test.js
Angelos Chalaris a78f5db260 Test migration to jest by hand
Apparently using regular expressions is way easier.
2018-06-18 15:15:56 +03:00

11 lines
357 B
JavaScript

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