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

12 lines
496 B
JavaScript

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