Skip to content

fix(random): prevent infinite do-while#1938

Merged
Shinigami92 merged 2 commits intonextfrom
fix-infinite-do-while-in-random-word
Mar 16, 2023
Merged

fix(random): prevent infinite do-while#1938
Shinigami92 merged 2 commits intonextfrom
fix-infinite-do-while-in-random-word

Conversation

@Shinigami92
Copy link
Copy Markdown
Member

@Shinigami92 Shinigami92 added the c: bug Something isn't working label Mar 15, 2023
@Shinigami92 Shinigami92 requested a review from a team as a code owner March 15, 2023 16:54
@Shinigami92 Shinigami92 self-assigned this Mar 15, 2023
@Shinigami92 Shinigami92 requested a review from a team March 15, 2023 16:55
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 15, 2023

Codecov Report

❗ No coverage uploaded for pull request base (next@f2abf8b). Click here to learn what that means.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #1938   +/-   ##
=======================================
  Coverage        ?   99.62%           
=======================================
  Files           ?     2357           
  Lines           ?   236856           
  Branches        ?     1225           
=======================================
  Hits            ?   235973           
  Misses          ?      861           
  Partials        ?       22           
Impacted Files Coverage Δ
src/modules/random/index.ts 100.00% <100.00%> (ø)

Copy link
Copy Markdown
Member

@xDivisionByZerox xDivisionByZerox left a comment

Choose a reason for hiding this comment

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

Could we get a test that verifies this behavior?

Something like this?

it('fails if no data are avalible', () => {
  const faker = new Faker();
  faker.definitions = {};

  expect(() => faker.random.word()).toThrowError();
});

@xDivisionByZerox xDivisionByZerox added needs test More tests are needed s: accepted Accepted feature / Confirmed bug labels Mar 15, 2023
Comment thread src/modules/random/index.ts
@xDivisionByZerox xDivisionByZerox removed the needs test More tests are needed label Mar 15, 2023
@ST-DDT ST-DDT added the p: 1-normal Nothing urgent label Mar 15, 2023
@Shinigami92 Shinigami92 merged commit 256631d into next Mar 16, 2023
@Shinigami92 Shinigami92 deleted the fix-infinite-do-while-in-random-word branch March 16, 2023 08:46
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 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.

5 participants