Added tests for new date snippets

This commit is contained in:
Angelos Chalaris
2018-09-29 14:29:56 +03:00
parent e8d4ad78d9
commit 29bd1d0a3c
20 changed files with 96 additions and 10 deletions

View File

@ -0,0 +1,15 @@
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));
});