faker icon indicating copy to clipboard operation
faker copied to clipboard

feat(internet): add jwt method

Open eLoyyyyy opened this issue 1 year ago • 8 comments

Closes #1282

eLoyyyyy avatar Jun 04 '24 10:06 eLoyyyyy

Deploy Preview for fakerjs ready!

Name Link
Latest commit 5c3f33d255f5ec859862515a63ad6afec2ded77a
Latest deploy log https://app.netlify.com/sites/fakerjs/deploys/6718f231d852a600084e2d8b
Deploy Preview https://deploy-preview-2936.fakerjs.dev
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Jun 04 '24 10:06 netlify[bot]

Codecov Report

Attention: Patch coverage is 91.37931% with 5 lines in your changes missing coverage. Please review.

Project coverage is 99.95%. Comparing base (48931a5) to head (5c3f33d). Report is 1 commits behind head on next.

Files with missing lines Patch % Lines
src/internal/base64.ts 37.50% 5 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             next    #2936      +/-   ##
==========================================
- Coverage   99.96%   99.95%   -0.01%     
==========================================
  Files        2796     2797       +1     
  Lines      216704   216762      +58     
  Branches      953      578     -375     
==========================================
+ Hits       216628   216672      +44     
- Misses         76       90      +14     
Files with missing lines Coverage Δ
src/definitions/internet.ts 100.00% <ø> (ø)
src/locales/base/internet/index.ts 100.00% <100.00%> (ø)
src/locales/base/internet/jwt_algorithm.ts 100.00% <100.00%> (ø)
src/modules/internet/index.ts 100.00% <100.00%> (ø)
src/internal/base64.ts 33.33% <37.50%> (+3.33%) :arrow_up:

... and 1 file with indirect coverage changes

codecov[bot] avatar Jun 05 '24 20:06 codecov[bot]

is this up for review? or should I wait a bit?

Shinigami92 avatar Jun 13 '24 11:06 Shinigami92

Discussion point has been removed for being off topic


@eLoyyyyy the test snapshots as well as some formatting needs to be updated. You can run pnpm run preflight to run CI locally before committing. That way you don't have to wait for results from CI. Alternativly, have a look at our CONTRIBUTING Guidelines for more information on how to fix common problems.

xDivisionByZerox avatar Jun 18 '24 08:06 xDivisionByZerox

The formatting seems to be off in the documentation:

image

I dont see the problem. What would you expect?

ST-DDT avatar Jun 18 '24 09:06 ST-DDT

@eLoyyyyy the test snapshots as well as some formatting needs to be updated. You can run pnpm run preflight to run CI locally before committing. That way you don't have to wait for results from CI. Alternativly, have a look at our CONTRIBUTING Guidelines for more information on how to fix common problems.

Updated the test snapshots. My bad for not running preflight before pushing code.

eLoyyyyy avatar Jun 18 '24 12:06 eLoyyyyy

I dont see the problem. What would you expect?

The current documentation show this:

function jwt(
    options: {
      header?: Record<string, unknown>;
      payload?: Record<string, unknown>;
      refDate?: string | Date | number;
    } = {}
  ): string;
faker.internet.jwt() //...

I would expect standardized prettier formatting (look at the whitespaces):

function jwt(
  options: {
    header?: Record<string, unknown>;
    payload?: Record<string, unknown>;
    refDate?: string | Date | number;
  } = {}
): string;
faker.internet.jwt() //...

I can see this on other functions as well (example: internet.mac(), number.bigInt()). Because of that I dismiss this topic from this PR and put it in our meeting notes.

xDivisionByZerox avatar Jun 18 '24 18:06 xDivisionByZerox

@eLoyyyyy Could you please fix the merge conflicts?

ST-DDT avatar Oct 12 '24 23:10 ST-DDT

@xDivisionByZerox Could you please review this PR (or dismiss your previous one)?

ST-DDT avatar Oct 23 '24 12:10 ST-DDT

Thank you for you contribution. ❤️

This feature will be available in the upcoming v9.1 release of faker.

ST-DDT avatar Oct 23 '24 22:10 ST-DDT