-
-
Notifications
You must be signed in to change notification settings - Fork 950
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
fix: accept dates as params for Date methods #200
Conversation
✔️ Deploy Preview for vigilant-wescoff-04e480 ready! 🔨 Explore the source changes: c03bd39 🔍 Inspect the deploy log: https://app.netlify.com/sites/vigilant-wescoff-04e480/deploys/61eb4621ab6f360008224c99 😎 Browse the preview: https://deploy-preview-200--vigilant-wescoff-04e480.netlify.app |
Due to this is a runtime change, I think we will do this in v6.1, because we try to focus on stability of the project itself first (CI, tests, docs etc) |
I only got to this change, because my current code start failing after the upgrade. So this is not strictly a new feature, but restoring functionality working with previous version of faker. |
Speaking about unit tests, could you add one? |
Done. If you would be using |
Btw. good that you asked about tests, as I discovered a bug, where original date was incorrectly mutated... |
I had a similar experience to @pkuczynski - attempting to replace the old faker-js package with this new one caused errors in previously working code. I am confident that most (if not all) of the Date functions used to support Date() fields. This is supported by the fact that in the documentation for Dates all of the functions take Date objects instead of strings (or at least the ones that were already documented). Speaking of which the docs should probably be updated in this branch to better reflect the type definitions (e.g Thank you @pkuczynski for looking into this issue, it is the primary roadblock between my organisation switching our frontend repository to the community faker-js package. |
…hanges in the Date API.
I have made a pull request in @pkuczynski 's fork with the updated documentation. :) |
And I just merged it, thanks :) |
@Shinigami92 Is there anything else you want me to do to get this PR accepted, merged and released? |
You will love our next PR incoming :P |
Citing their docs: "It's not recommended to migrate your current testing setups yet" ;) So I am not sure :) Is it jest based? |
Co-authored-by: Shinigami <chrissi92@hotmail.de>
I'm one of Vite core members and in direct contact with Anthony Fu 🙂 |
@Shinigami92 rebased and feedback applied. Let me know if anything is still missing? |
Added missing jsdoc to these new functions, after you converted them from arrow. Anything else @Shinigami92? |
I'm in bed now ^^ |
Codecov Report
@@ Coverage Diff @@
## main #200 +/- ##
=======================================
Coverage 99.33% 99.33%
=======================================
Files 1923 1923
Lines 176857 176860 +3
Branches 908 913 +5
=======================================
+ Hits 175687 175690 +3
Misses 1114 1114
Partials 56 56
|
Fixes #198