Files
30-seconds-of-code/test/maxDate/maxDate.test.js
2018-09-29 14:29:56 +03:00

16 lines
402 B
JavaScript

const expect = require('expect');
const maxDate = require('./maxDate.js');
test('maxDate is a Function', () => {
expect(maxDate).toBeInstanceOf(Function);
});
test('maxDate produces the maximum date', () => {
const array = [
new Date(2017, 4, 13),
new Date(2018, 2, 12),
new Date(2016, 0, 10),
new Date(2016, 0, 9)
];
expect(maxDate(array)).toEqual(new Date(2018, 2, 12));
});