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: special characters in emails #792

Merged
merged 13 commits into from
Apr 8, 2022

Conversation

harsohailB
Copy link
Contributor

Resolves:

#272

Key Changes:

  • Added config: EmailConfig option to generate email() and exampleEmail()
  • Used the following source to randomly replace username characters with accepted email characters !#$%&'*+-/=?^_`{|}~

Tests:

  • Added tests for both email() and exampleEmail() with the added config to test special characters in emails

@harsohailB harsohailB requested a review from a team as a code owner April 6, 2022 22:10
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.

I would like that we also add seeded based tests for this example, so we can also test the deterministic

src/internet.ts Outdated Show resolved Hide resolved
src/internet.ts Outdated Show resolved Hide resolved
src/internet.ts Outdated Show resolved Hide resolved
src/internet.ts Outdated Show resolved Hide resolved
@Shinigami92 Shinigami92 added c: feature Request for new feature p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug labels Apr 7, 2022
@Shinigami92 Shinigami92 added this to the v6.2 - New small features milestone Apr 7, 2022
@Shinigami92 Shinigami92 linked an issue Apr 7, 2022 that may be closed by this pull request
src/internet.ts Outdated Show resolved Hide resolved
src/definitions/internet.ts Outdated Show resolved Hide resolved
src/internet.ts Outdated Show resolved Hide resolved
@Shinigami92
Copy link
Member

Should we go for an explicit type or an inline type? AFAIK we currently use only inline types.

I also thought about that and maybe we should just go with inline for now.

@codecov
Copy link

codecov bot commented Apr 7, 2022

Codecov Report

Merging #792 (853a3ee) into main (78a30fb) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 853a3ee differs from pull request most recent head d07c12a. Consider uploading reports for the commit d07c12a to get more accurate results

@@            Coverage Diff             @@
##             main     #792      +/-   ##
==========================================
- Coverage   99.35%   99.34%   -0.01%     
==========================================
  Files        1921     1921              
  Lines      179085   177142    -1943     
  Branches      909      911       +2     
==========================================
- Hits       177932   175990    -1942     
+ Misses       1097     1096       -1     
  Partials       56       56              
Impacted Files Coverage Δ
src/internet.ts 100.00% <100.00%> (ø)
src/locales/en/system/mimeTypes.ts 100.00% <0.00%> (ø)
src/utils/user-agent.ts 98.11% <0.00%> (+0.26%) ⬆️

src/internet.ts Outdated Show resolved Hide resolved
@harsohailB
Copy link
Contributor Author

harsohailB commented Apr 7, 2022

I would like that we also add seeded based tests for this example, so we can also test the deterministic

Is there an example for this that I can follow? @Shinigami92 @ST-DDT

edit: Additionally, the inclusion of special characters is based on the options input and not randomness so how would seed testing even work for this?

src/internet.ts Outdated Show resolved Hide resolved
src/internet.ts Outdated Show resolved Hide resolved
src/internet.ts Outdated Show resolved Hide resolved
src/internet.ts Outdated Show resolved Hide resolved
Co-authored-by: ST-DDT <ST-DDT@gmx.de>
src/internet.ts Outdated Show resolved Hide resolved
@ST-DDT ST-DDT requested review from a team April 8, 2022 16:29
@Shinigami92 Shinigami92 enabled auto-merge (squash) April 8, 2022 16:29
@Shinigami92 Shinigami92 merged commit 3b5a21f into faker-js:main Apr 8, 2022
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 p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Special characters in email
3 participants