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: empty array passed into helpers.arrayElements #921

Merged
merged 3 commits into from
May 4, 2022

Conversation

c0per
Copy link
Contributor

@c0per c0per commented May 4, 2022

No description provided.

@c0per c0per requested a review from a team as a code owner May 4, 2022 08:39
@Shinigami92 Shinigami92 changed the title fix helpers.arrayElements (#920) fix: empty array passed into helpers.arrayElements May 4, 2022
@Shinigami92 Shinigami92 linked an issue May 4, 2022 that may be closed by this pull request
Copy link
Member

@Shinigami92 Shinigami92 left a comment

Choose a reason for hiding this comment

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

What happens if you pass an empty array but also pass a count greater than 0?
Could you add a second test for this case?

@codecov
Copy link

codecov bot commented May 4, 2022

Codecov Report

Merging #921 (8c3761b) into main (788af82) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #921   +/-   ##
=======================================
  Coverage   99.65%   99.65%           
=======================================
  Files        1958     1958           
  Lines      210666   210669    +3     
  Branches      907      909    +2     
=======================================
+ Hits       209930   209934    +4     
+ Misses        717      716    -1     
  Partials       19       19           
Impacted Files Coverage Δ
src/modules/helpers/index.ts 99.01% <100.00%> (+0.12%) ⬆️

@c0per
Copy link
Contributor Author

c0per commented May 4, 2022

What happens if you pass an empty array but also pass a count greater than 0?
Could you add a second test for this case?

Sure, added.

@Shinigami92 Shinigami92 requested review from a team May 4, 2022 09:01
@Shinigami92 Shinigami92 added this to the v7 - Current Major milestone May 4, 2022
@Shinigami92 Shinigami92 added c: bug Something isn't working p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug labels May 4, 2022
@Shinigami92 Shinigami92 merged commit 100a1ea into faker-js:main May 4, 2022
@xDivisionByZerox xDivisionByZerox added the m: helpers Something is referring to the helpers module label Aug 26, 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 m: helpers Something is referring to the helpers module p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Throwing an Error when passing empty array to helpers.ArrayElements
4 participants