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

feat: fake with multiple parameters #1459

Merged
merged 13 commits into from
Oct 23, 2022
Merged

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Oct 15, 2022

Adds support for method calls with multiple parameters in fake()

Example:

faker.helpers.fake('I rolled the dice and got: {{random.numeric(5, {"bannedDigits": "12345678"})}}')

Result:

I rolled the dice and got: 6

Docs Preview

grafik

@ST-DDT ST-DDT added c: feature Request for new feature p: 1-normal Nothing urgent s: needs decision Needs team/maintainer decision m: helpers Something is referring to the helpers module labels Oct 15, 2022
@ST-DDT ST-DDT requested review from a team October 15, 2022 21:50
@ST-DDT ST-DDT self-assigned this Oct 15, 2022
@ST-DDT ST-DDT added the s: on hold Blocked by something or frozen to avoid conflicts label Oct 15, 2022
@ST-DDT
Copy link
Member Author

ST-DDT commented Oct 15, 2022

Blocked by #1458

@codecov
Copy link

codecov bot commented Oct 16, 2022

Codecov Report

Merging #1459 (5e7a86d) into next (f4907a1) will not change coverage.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #1459   +/-   ##
=======================================
  Coverage   99.63%   99.63%           
=======================================
  Files        2165     2165           
  Lines      237132   237132           
  Branches     1020     1017    -3     
=======================================
  Hits       236266   236266           
  Misses        845      845           
  Partials       21       21           
Impacted Files Coverage Δ
src/modules/helpers/index.ts 98.44% <100.00%> (ø)

src/modules/helpers/index.ts Outdated Show resolved Hide resolved
@ST-DDT ST-DDT requested review from Shinigami92 and a team October 16, 2022 11:41
Shinigami92
Shinigami92 previously approved these changes Oct 16, 2022
Shinigami92
Shinigami92 previously approved these changes Oct 16, 2022
@ST-DDT ST-DDT removed the s: on hold Blocked by something or frozen to avoid conflicts label Oct 16, 2022
@Shinigami92 Shinigami92 added s: accepted Accepted feature / Confirmed bug and removed s: needs decision Needs team/maintainer decision labels Oct 16, 2022
Copy link
Member

@import-brain import-brain left a comment

Choose a reason for hiding this comment

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

Please replace all instances of random.numeric with string.numeric to fix tests

@ST-DDT ST-DDT enabled auto-merge (squash) October 23, 2022 18:28
@ST-DDT ST-DDT merged commit 2eb2537 into next Oct 23, 2022
@ST-DDT ST-DDT deleted the feat/fake-multiple-parameters branch October 23, 2022 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: feature Request for new feature 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.

3 participants