Added tests for new date snippets
This commit is contained in:
2
test/isSameDate/isSameDate.js
Normal file
2
test/isSameDate/isSameDate.js
Normal file
@@ -0,0 +1,2 @@
|
||||
const isSameDate = (dateA, dateB) => dateA.toISOString() === dateB.toISOString();
|
||||
module.exports = isSameDate;
|
||||
12
test/isSameDate/isSameDate.test.js
Normal file
12
test/isSameDate/isSameDate.test.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const expect = require('expect');
|
||||
const isSameDate = require('./isSameDate.js');
|
||||
|
||||
test('isSameDate is a Function', () => {
|
||||
expect(isSameDate).toBeInstanceOf(Function);
|
||||
});
|
||||
test('isSameDate produces the correct result', () => {
|
||||
expect(isSameDate(new Date(2010, 10, 20), new Date(2010, 10, 20))).toBeTruthy();
|
||||
});
|
||||
test('isSameDate produces the correct result', () => {
|
||||
expect(isSameDate(new Date(2010, 10, 20), new Date(2010, 10, 21))).toBeFalsy();
|
||||
});
|
||||
Reference in New Issue
Block a user