Added tests for new date snippets
This commit is contained in:
15
test/maxDate/maxDate.test.js
Normal file
15
test/maxDate/maxDate.test.js
Normal 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));
|
||||
});
|
||||
Reference in New Issue
Block a user