-
-
Notifications
You must be signed in to change notification settings - Fork 953
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(finance): routingNumber now uses real FederalReserveRoutingSymbol from lookup table. #3429
base: next
Are you sure you want to change the base?
Conversation
…). Added some conditions to random-seeded finance.routingNumber test. Updated finance test snapshot.
… directive snuck into the index.ts file.
✅ 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 #3429 +/- ##
========================================
Coverage 99.97% 99.97%
========================================
Files 2811 2813 +2
Lines 216972 217149 +177
Branches 944 943 -1
========================================
+ Hits 216917 217094 +177
Misses 55 55
|
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.
Let's add a little more detail to the method description
e.g.
"Generates a random routing number."
=>
"Generates a random [ABA routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number)"
…age for ABA Routing Number. Updated the example string given to reflect the new changes.
Done. I used one of the routing numbers from the test snapshot for the example string. |
Also, I forgot to mention... I couldn't figure out how to link the original issue to this PR. Sorry I am a bit new to contributing to public github repos. |
Also, as I'm sure you've noticed, I skipped any form of testing whether the 2nd group of 2 digits at indexes 2-3 actually matched up with one of the numbers listed in the base finance locale. Of course were I to do that, what I'd really be doing is simply checking if Edit: On a site note, it was interesting to find out that validate.js's Edit 2: After looking at the validator.js source again, I had missed this regex at the top:
Which is checking (though not obviously, of course) that the federal reserve district is correct. Quoted from the wikipedia page on ABA routing numbers:
So that regex is effectively trying to be as exhaustive as possible, almost like an official spec would, except it's a little bizarre for two reasons: One is that it is allowing 000000000, which passes even the check digit validation and is definitely not a valid routing number. So tl;dr the call to |
The timeouts happen randomly unfortunately. Even if we increase it to 30s. As for the pnpm update, you might have to update node to the latest (LTS) version. That solved it for me. |
Okay that makes me feel better that I didn't do something and break it unwittingly. I'll try again after work today. |
Okay I tried again and it didn't time out this time. Pushed up the changes you mentioned. |
Fixes #3290
finance.routingNumber is now comprised as follows:
Digits 0-3 = Pulled from locales/base/finance/federal_reserve_routing_symbol.ts
Digits 4-7 = Random
Digit 8 = Check digit. Calculated from the previous 8 digits as before.
Added more test conditions to the randomly-seeded finance.routingNumber test.