Files
30-seconds-of-code/test/everyNth/everyNth.test.js
Angelos Chalaris cc7b76d0b3 Test files linted
2018-08-03 10:39:26 +03:00

10 lines
286 B
JavaScript

const expect = require('expect');
const everyNth = require('./everyNth.js');
test('everyNth is a Function', () => {
expect(everyNth).toBeInstanceOf(Function);
});
test('Returns every nth element in an array', () => {
expect(everyNth([1, 2, 3, 4, 5, 6], 2)).toEqual([2, 4, 6]);
});