-
-
Notifications
You must be signed in to change notification settings - Fork 920
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
test(internet): fix username expecting numbers with length 2 #1284
test(internet): fix username expecting numbers with length 2 #1284
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1284 +/- ##
==========================================
- Coverage 99.62% 99.62% -0.01%
==========================================
Files 2154 2154
Lines 239914 239914
Branches 1003 1002 -1
==========================================
- Hits 239015 239014 -1
- Misses 878 879 +1
Partials 21 21
|
Please use the new PR title naming convention: https://github.com/faker-js/faker/blob/main/CONTRIBUTING.md#committing |
Maybe it wanted to generate 00-09? |
Because it doesn't generate random numbers in the test currently. |
It did fail at one point in #1059. That's why that PR has a dedicated commit to fix that issue. But since this issue can potentially hit any other contributor at any time I wanted to take it out of that PR. |
Found in #1059.
The implementation of
internet.username()
uses the provided first and last name and can append a random number to them. This number is between 0 and 99 (inclusive).faker/src/modules/internet/index.ts
Lines 142 to 145 in 93ef876
The test on the other hand side uses a regex that expects the email to have a number (if existing) that has at least a length of 2.
This PR fixes the described issue.