Skip to content

feat(person)!: default includeGeneric option set to true in sexType() - #4151

Open
gustavoreino wants to merge 16 commits into
faker-js:nextfrom
gustavoreino:feat/sex-type-default-generic
Open

gustavoreino wants to merge 16 commits into
faker-js:nextfrom
gustavoreino:feat/sex-type-default-generic

Conversation

@gustavoreino

Copy link
Copy Markdown

Description

To address issue #3694, this PR updates faker.person.sexType() so that includeGeneric defaults to true instead of false when no arguments or options are provided.

Summary of Changes

  • Updated personSexType default options to set includeGeneric = true in src/modules/person/module.ts and src/modules/person/sex-type.ts.
  • Updated JSDoc annotations and @default tags in person module definitions.
  • Updated regex expectations in test/modules/image.spec.ts (personPortrait) to allow 'generic' in generated image URLs.
  • Updated unit test assertions and snapshots across modules where default RNG output sequences shifted under fixed seeds (git, internet, image, location).
  • Updated test/modules/person.spec.ts to test new faker.person.sexType() default behaviour.

Breaking Changes

faker.person.sexType() now returns 'female', 'male', or 'generic' by default when called without options.

Previous behavior:

faker.person.sexType(); // 'female' | 'male'

@gustavoreino
gustavoreino requested a review from a team as a code owner October 15, 2026 02:51
@netlify

netlify Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for fakerjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 78e9692
🔍 Latest deploy log https://app.netlify.com/projects/fakerjs/deploys/6af2705c6b2e8af89002fb99
😎 Deploy Preview https://deploy-preview-4151.fakerjs.dev
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

Comment thread test/modules/image.spec.ts Resolved
Comment thread docs/guide/upgrading.md Resolved
matthewmayer
matthewmayer previously approved these changes Oct 21, 2026
@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.18%. Comparing base (b13a487) to head (8c3cb58).

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #4151   +/-   ##
=======================================
  Coverage   99.18%   99.18%           
=======================================
  Files        1179     1179           
  Lines        3941     3941           
  Branches      711      711           
=======================================
  Hits         3909     3909           
  Misses         28       28           
  Partials        4        4           
Files with missing lines Coverage Δ
src/modules/image/person-portrait.ts 100.00% <100.00%> (ø)
src/modules/person/module.ts 100.00% <ø> (ø)
src/modules/person/sex-type.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Shinigami92
Shinigami92 previously approved these changes Oct 23, 2026
@gustavoreino
gustavoreino dismissed stale reviews from matthewmayer and Shinigami92 via 037ec93 October 27, 2026 22:45
@gustavoreino

gustavoreino commented Nov 10, 2026 •

Copy link
Copy Markdown
Author

I adjusted the code to pass the last test necessary, all that's left is the owner's review @matthewmayer @Shinigami92

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants