Added tests for new date snippets
This commit is contained in:
2
test/isAfterDate/isAfterDate.js
Normal file
2
test/isAfterDate/isAfterDate.js
Normal file
@ -0,0 +1,2 @@
|
||||
const isAfterDate = (dateA, dateB) => dateA > dateB;
|
||||
module.exports = isAfterDate;
|
||||
12
test/isAfterDate/isAfterDate.test.js
Normal file
12
test/isAfterDate/isAfterDate.test.js
Normal 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();
|
||||
});
|
||||
Reference in New Issue
Block a user