Skip to content

fix: empty array passed into helpers.arrayElements#921

Merged
Shinigami92 merged 3 commits into
faker-js:mainfrom
c0per:main
May 4, 2022
Merged

fix: empty array passed into helpers.arrayElements#921
Shinigami92 merged 3 commits into
faker-js:mainfrom
c0per:main

Conversation

@c0per

@c0per c0per commented May 4, 2022

Copy link
Copy Markdown
Contributor

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

@Shinigami92 Shinigami92 left a comment

Copy link
Copy Markdown
Member

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

codecov Bot commented May 4, 2022

Copy link
Copy Markdown

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

c0per commented May 4, 2022

Copy link
Copy Markdown
Contributor Author

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

4 participants