-
-
Notifications
You must be signed in to change notification settings - Fork 906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(date)!: fail on invalid dates #2757
Conversation
✅ Deploy Preview for fakerjs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #2757 +/- ##
==========================================
+ Coverage 99.92% 99.94% +0.01%
==========================================
Files 2958 2958
Lines 213713 213686 -27
Branches 947 949 +2
==========================================
+ Hits 213560 213569 +9
+ Misses 153 117 -36
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wondered why the snapshots are different, but this is due to not calling date.setTime(future/past)
anymore. This is okay to me, as it is still on the same Day, but just a different time.
So there is only one thing we can improve in the vitest test, and then I'm okay with approving this
Both date and time are different for all methods in the past. Because we now generate the range directly instead of subtracting it. So the result is basically flipped. |
If a given date is invalid, it is treated as an error instead of falling back to
refDateSource