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

12 lines
337 B
JavaScript

const expect = require('expect');
const forEachRight = require('./forEachRight.js');
test('forEachRight is a Function', () => {
expect(forEachRight).toBeInstanceOf(Function);
});
let output = '';
forEachRight([1, 2, 3, 4], val => (output += val));
test('Iterates over the array in reverse', () => {
expect(output).toBe('4321');
});