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

Birthdate with default values return age less than 18 #2534

Closed
9 of 10 tasks
mumumilk opened this issue Nov 8, 2023 · 1 comment · Fixed by #2535
Closed
9 of 10 tasks

Birthdate with default values return age less than 18 #2534

mumumilk opened this issue Nov 8, 2023 · 1 comment · Fixed by #2535
Assignees
Labels
c: bug Something isn't working m: date Something is referring to the date module p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug
Milestone

Comments

@mumumilk
Copy link
Contributor

mumumilk commented Nov 8, 2023

Pre-Checks

Describe the bug

I was running into flaky tests in my application, and narrowed it down to faker's date.birthdate method.

According to the docs:

The options to use to generate the birthdate. If no options are set, an age between 18 and 80 (inclusive) is generated.

But there are times that an age less than 18 years old is generated. This does not happen every time, but I was able to get a specific seed and refDate to reproduce the issue.

Minimal reproduction code

https://stackblitz.com/edit/vitest-dev-vitest-md9oj6?file=test%2Fsuite.test.ts

Additional Context

No response

Environment Info

System:
    OS: macOS 13.0
    CPU: (8) arm64 Apple M2
    Memory: 65.42 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.20.2 - ~/.nvm/versions/node/v16.20.2/bin/node
    npm: 8.19.4 - ~/.nvm/versions/node/v16.20.2/bin/npm
    pnpm: 8.6.1 - ~/Library/pnpm/pnpm
    bun: 1.0.0 - ~/.bun/bin/bun
  Browsers:
    Chrome: 119.0.6045.123
    Edge: 119.0.2151.46
  npmPackages:
    @faker-js/faker: ^8.2.0 => 8.2.0

Which module system do you use?

  • CJS
  • ESM

Used Package Manager

npm

@mumumilk mumumilk added c: bug Something isn't working s: pending triage Pending Triage labels Nov 8, 2023
@ST-DDT ST-DDT added p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug m: date Something is referring to the date module and removed s: pending triage Pending Triage labels Nov 9, 2023
@ST-DDT ST-DDT added this to the vAnytime milestone Nov 9, 2023
@ST-DDT
Copy link
Member

ST-DDT commented Nov 9, 2023

I can confirm the bug.

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 m: date Something is referring to the date module p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants