Skip to content

avoid 0 as streetAddressNumber#1774

Merged
kingthorin merged 1 commit intodatafaker-net:mainfrom
fhueter:main
Mar 11, 2026
Merged

avoid 0 as streetAddressNumber#1774
kingthorin merged 1 commit intodatafaker-net:mainfrom
fhueter:main

Conversation

@fhueter
Copy link
Contributor

@fhueter fhueter commented Mar 11, 2026

I've just stumbled across a failed test and found that datafaker produced '0' as streetAddressNumber.

IMHO that makes no sense, so I fixed it to use a random number between 1 and 1000 instead of 0 and 1000 (with min and max included in both cases).

I've also did some naming cleanup in related tests as they kind of confused me in the very beginning.

@what-the-diff
Copy link

what-the-diff bot commented Mar 11, 2026

PR Summary

  • The 'streetAddressNumber' method has been adjusted
    Now, this method will return a number between 1 and 999 instead of between 0 and 999. This is to ensure that the street address always starts from 1.

  • Improvements to the 'streetAddress' method
    The method for determining the street address has been made simpler and more direct in how it works. This should mean the process is faster and more efficient than before.

  • Changes to the method test for street addresses
    The test is updated to match these changes:

    • There's a new variable name which is more suitable and avoids any confusion - it is now called 'streetAddress' instead of 'streetAddressNumber'
    • We've fixed the test cases to ensure that new street address numbers are always above zero. This ensures our addresses are accurate and align perfectly with the updated method now.

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.33%. Comparing base (d5d0d53) to head (199ac66).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1774      +/-   ##
============================================
- Coverage     92.40%   92.33%   -0.08%     
+ Complexity     3449     3446       -3     
============================================
  Files           339      339              
  Lines          6794     6794              
  Branches        670      670              
============================================
- Hits           6278     6273       -5     
- Misses          352      354       +2     
- Partials        164      167       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@kingthorin kingthorin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@kingthorin kingthorin merged commit 63d94ca into datafaker-net:main Mar 11, 2026
13 checks passed
@asolntsev asolntsev added this to the 2.6.0 milestone Mar 11, 2026
@asolntsev asolntsev added the enhancement New feature or request label Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants