Added tests for new date snippets

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

View File

@ -0,0 +1,2 @@
const isAfterDate = (dateA, dateB) => dateA > dateB;
module.exports = isAfterDate;

View File

@ -0,0 +1,12 @@
const expect = require('expect');
const isAfterDate = require('./isAfterDate.js');
test('isAfterDate is a Function', () => {
expect(isAfterDate).toBeInstanceOf(Function);
});
test('isAfterDate produces the correct result', () => {
expect(isAfterDate(new Date(2010, 10, 21), new Date(2010, 10, 20))).toBeTruthy();
});
test('isBeforeDate produces the correct result', () => {
expect(isAfterDate(new Date(2010, 10, 20), new Date(2010, 10, 21))).toBeFalsy();
});