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

✨ Add support for "Invalid Date" in date #4197

Merged
merged 8 commits into from
Sep 5, 2023
Merged

✨ Add support for "Invalid Date" in date #4197

merged 8 commits into from
Sep 5, 2023

Conversation

dubzzz
Copy link
Owner

@dubzzz dubzzz commented Sep 4, 2023

Up-to-now, the arbitrary called date() was unable to generate "Invalid Date". Following this PR, it will be able to do so, if you provide it with the flag noInvalidDate: false.

In the next major version of fast-check, this flag will default to false (while today it defaults to true not to break existing clients).

Fixes #1064

Category:

  • ✨ Introduce new features
  • 📝 Add or update documentation
  • ✅ Add or update tests
  • 🐛 Fix a bug
  • 🏷️ Add or update types
  • ⚡️ Improve performance
  • Other(s): ...

Potential impacts:

  • Generated values
  • Shrink values
  • Performance
  • Typings
  • Other(s): ...

Sorry, something went wrong.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Up-to-now, the arbitrary called `date()` was unable to generate "Invalid Date". Following this PR, it will be able to do so, if you provide it with the flag `noInvalidDate: false`.

In the next major version of fast-check, this flag will default to false (while today it defaults to true not to break existing clients).

Fixes #1064
@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 4, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 0ec6c41:

Sandbox Source
Vanilla Configuration
@fast-check/examples Configuration

@codecov
Copy link

codecov bot commented Sep 5, 2023

Codecov Report

Merging #4197 (0ec6c41) into main (2cf60d5) will increase coverage by 0.01%.
Report is 7 commits behind head on main.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #4197      +/-   ##
==========================================
+ Coverage   94.67%   94.68%   +0.01%     
==========================================
  Files         211      211              
  Lines        5934     5947      +13     
  Branches     1360     1365       +5     
==========================================
+ Hits         5618     5631      +13     
  Misses        300      300              
  Partials       16       16              
Flag Coverage Δ
unit-tests 94.68% <100.00%> (+0.01%) ⬆️
unit-tests-16.x-Linux 94.68% <100.00%> (+0.01%) ⬆️
unit-tests-18.x-Linux 94.68% <100.00%> (+0.01%) ⬆️
unit-tests-latest-Linux 94.68% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...eck/src/arbitrary/_internals/mappers/TimeToDate.ts 100.00% <100.00%> (ø)
packages/fast-check/src/arbitrary/date.ts 100.00% <100.00%> (ø)

@dubzzz dubzzz merged commit 5e52736 into main Sep 5, 2023
@dubzzz dubzzz deleted the invalid-date branch September 5, 2023 20:47
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.

fc.date should produce Invalid Dates by default
1 participant