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(random): prevent infinite do-while #1938

Merged
merged 2 commits into from
Mar 16, 2023

Conversation

Shinigami92
Copy link
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

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
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
src/modules/random/index.ts Show resolved Hide resolved
@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.

None yet

5 participants