This is the test suite for the calcBillingPeriods
function.
-
Clone this repository:
git clone (https://github.com/fasileds/jest-test.git) cd calcBillingPeriods
-
Install dependencies:
npm install
Run the tests using:
npm test
should return false when periodYear is invalid
should return false when periodYear is not a valid year (e.g., 999)
should return false when cutoffDate is outside valid range (less than 1)
should return false when cutoffDate is outside valid range (greater than 31)
should return an array of periods when all inputs are valid
should return the correct months in the format YYYY-MM-01
should handle edge cases where month transitions from December to January
The test suite may fail due to missing functions such as nearestNextValidDate
and nearestPrevValidDate
in calcBillingPeriods.js
.
MIT License