Skip to content

Error when generation passport without specifying locale#282

Merged
panilya merged 2 commits into
datafaker-net:masterfrom
panilya:default-locale-passport-test
Aug 9, 2022
Merged

Error when generation passport without specifying locale#282
panilya merged 2 commits into
datafaker-net:masterfrom
panilya:default-locale-passport-test

Conversation

@panilya

@panilya panilya commented Aug 8, 2022

Copy link
Copy Markdown
Collaborator

There is "passport.valid resulted in null expression" error when generating passport number without specifying Locale.

Edit:
There is Locale.ENGLISH - public static final Locale ENGLISH = createConstant("en", ""); without specifying country and there is Locale.US - public static final Locale US = createConstant("en", "US");. Datafaker uses Locale.ENGLISH and there are a lot of problems involving this choice, for example: incorrect resolving of phone_number formats. When changing Faker to Locale.US everything works fine. Should I change default Locale to Locale.US in Faker?

@panilya panilya requested a review from bodiam August 8, 2022 08:36
@bodiam

bodiam commented Aug 8, 2022

Copy link
Copy Markdown
Contributor

Hmm, if you change the default locale, not a single test breaks? Cause if that's the case, I'd say go for it

@panilya

panilya commented Aug 8, 2022

Copy link
Copy Markdown
Collaborator Author

This change has side effects, so I will not change the default locale to Locale.US.

@panilya panilya changed the title Add test for default locale in PassportTest Error when generation passport without specifying locale Aug 8, 2022
@codecov-commenter

codecov-commenter commented Aug 8, 2022

Copy link
Copy Markdown

⚠️ 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 94.78%. Comparing base (fd06c1f) to head (70785cf).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #282      +/-   ##
============================================
- Coverage     94.83%   94.78%   -0.06%     
+ Complexity     1879     1878       -1     
============================================
  Files           194      194              
  Lines          3777     3777              
  Branches        379      379              
============================================
- Hits           3582     3580       -2     
- Misses           99      100       +1     
- Partials         96       97       +1     

☔ 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.

@panilya

panilya commented Aug 8, 2022

Copy link
Copy Markdown
Collaborator Author

@bodiam Now it seems okay, is it a good approach to solve this bug?

@bodiam

bodiam commented Aug 8, 2022

Copy link
Copy Markdown
Contributor

I think so, I see no issue with this, and it's much better than what we had before, so let's use this.

@panilya panilya merged commit e5c5c34 into datafaker-net:master Aug 9, 2022
@panilya panilya deleted the default-locale-passport-test branch August 9, 2022 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants