Files
30-seconds-of-code/test/dropRight/dropRight.test.js
Angelos Chalaris 17fb304f04 Codacy issue fixes
2018-06-18 21:18:53 +03:00

16 lines
551 B
JavaScript

const expect = require('expect');
const dropRight = require('./dropRight.js');
test('dropRight is a Function', () => {
expect(dropRight).toBeInstanceOf(Function);
});
test('Returns a new array with n elements removed from the right', () => {
expect(dropRight([1, 2, 3])).toEqual([1, 2]);
});
test('Returns a new array with n elements removed from the right', () => {
expect(dropRight([1, 2, 3], 2)).toEqual([1]);
});
test('Returns a new array with n elements removed from the right', () => {
expect(dropRight([1, 2, 3], 42)).toEqual([]);
});