Skip to content
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: optional args on faker.finance.iban() #431

Merged
merged 1 commit into from Feb 5, 2022

Conversation

dantman
Copy link
Contributor

@dantman dantman commented Feb 5, 2022

faker.finance.iban() is a valid use of Faker. However in TypeScript you get a type error because the optional formatted and countryCode args are not marked as optional like in other functions.

Tests are written against the cjs bundle without types so did not catch the error.

`faker.finance.iban()` is a valid use of Faker. However in TypeScript you get a type error because the optional `formatted` and `countryCode` args are not marked as optional like in other functions.

Tests are written against the cjs bundle without types so did not catch the error.
@dantman dantman requested a review from a team as a code owner February 5, 2022 02:29
@codecov
Copy link

codecov bot commented Feb 5, 2022

Codecov Report

Merging #431 (20d7280) into main (0ee39d1) will not change coverage.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##             main     #431   +/-   ##
=======================================
  Coverage   94.24%   94.24%           
=======================================
  Files        1920     1920           
  Lines      173955   173955           
  Branches      108      108           
=======================================
  Hits       163942   163942           
  Misses       9905     9905           
  Partials      108      108           
Impacted Files Coverage Δ
src/finance.ts 0.00% <0.00%> (ø)

@ST-DDT
Copy link
Member

ST-DDT commented Feb 5, 2022

FFR: In definitely typed it was supported and the code (both impl and test) looks like it is optional as well. So we should restore the original behavior.

If you are familiar with ts, could you please also remove the ts-expect-error from the iban() calls in the finance_iban.spec.ts test file?

Thanks for your contribution.

@ST-DDT ST-DDT added the c: bug Something isn't working label Feb 5, 2022
@ST-DDT
Copy link
Member

ST-DDT commented Feb 5, 2022

I have to check why the code cov is reported as zero for this patch. The tests should be covering this.

@ST-DDT ST-DDT requested review from Shinigami92 and a team February 5, 2022 09:24
@dantman
Copy link
Contributor Author

dantman commented Feb 5, 2022

I have to check why the code cov is reported as zero for this patch. The tests should be covering this.

Maybe because that's a diff, I only made a one character type change, and none of the tests cover types.

@Shinigami92 Shinigami92 merged commit c71469c into faker-js:main Feb 5, 2022
demipel8 pushed a commit to demipel8/faker that referenced this pull request Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants