-
-
Notifications
You must be signed in to change notification settings - Fork 919
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: Luhn generation algorithms and tests #980
Conversation
@prisis Seems like the new luhnCheck function I pasted in causes tests to fail...👀 https://github.com/faker-js/faker/runs/6537655385?check_suite_focus=true |
Just tested the function: https://replit.com/@ericcheng2005/luhnTest#index.js Made sure the testcases I used in the Replit above were right too: |
Probably because the luhn value we are generating is broken too. |
Yeah, there's something wrong with |
Codecov Report
@@ Coverage Diff @@
## main #980 +/- ##
=======================================
Coverage 99.67% 99.67%
=======================================
Files 2111 2112 +1
Lines 225957 225980 +23
Branches 979 981 +2
=======================================
+ Hits 225217 225240 +23
Misses 720 720
Partials 20 20
|
Note: all of the numbers I changed the seeded tests to expect are Luhn-valid numbers, verified using https://simplycalc.com/luhn-validate.php |
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.
Good job :)
Co-authored-by: ST-DDT <[email protected]>
fixes #952