Files
30-seconds-of-code/test/getDaysDiffBetweenDates.test.js
Christian C. Salvadó 83a6a6ea32 [ENHANCEMENT] Properly configure eslint to work with jest (#988)
* chore: make aware eslint that we use jest

By setting up the jest environment, we no longer need to declare the
'test' global in the configuration.

* chore: don't need to import expect, it's a jest environment global

* chore: don't need to import expect when creating undefined test
2019-06-18 08:34:45 +03:00

9 lines
335 B
JavaScript

const {getDaysDiffBetweenDates} = require('./_30s.js');
test('getDaysDiffBetweenDates is a Function', () => {
expect(getDaysDiffBetweenDates).toBeInstanceOf(Function);
});
test('Returns the difference in days between two dates', () => {
expect(getDaysDiffBetweenDates(new Date('2017-12-13'), new Date('2017-12-22'))).toBe(9);
});