Files
30-seconds-of-code/test/minN/minN.test.js
2018-06-18 16:34:04 +03:00

15 lines
394 B
JavaScript

const expect = require('expect');
const minN = require('./minN.js');
test('minN is a Function', () => {
expect(minN).toBeInstanceOf(Function);
});
test('Returns the n minimum elements from the provided array', () => {
expect(minN([1, 2, 3])).toEqual([1])
});
test('Returns the n minimum elements from the provided array', () => {
expect(minN([1, 2, 3], 2), [1).toEqual(2])
});