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

πŸ’₯ Error with cause by default #4489

Merged
merged 7 commits into from
Nov 28, 2023
Merged

Conversation

dubzzz
Copy link
Owner

@dubzzz dubzzz commented Nov 28, 2023

πŸ’₯ Breaking change

Until now, fast-check have been merging the content and stack of the original Error that caused the property to fail into its own Error. With the recent (2022) introduction of cause on Errors, this complex logic can be dropped in favor of the native cause mechanism.

This PR makes cause mode the default. Before this PR, toggling it was possible via errorWithCause: true on fc.assert.

Given not all test runners properly support causes attached to the Error, we offer a fallback for users willing to preserve the old behaviour. It can be toggled via includeErrorInReport: true on fc.assert.

Related to #4416.

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): ...

We offer a fallback for users willing to preserve the old behaviour. Indeed, for now, not all test runners properly support causes attached to the Error. As a consequence, not offering a way to rely on the legacy format would block some users to V3.
Copy link

codesandbox-ci bot commented Nov 28, 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 97fbcff:

Sandbox Source
@fast-check/examples Configuration

Copy link

codecov bot commented Nov 28, 2023

Codecov Report

All modified and coverable lines are covered by tests βœ…

Comparison is base (6f9cfff) 93.29% compared to head (97fbcff) 93.39%.
Report is 1 commits behind head on next-3_14_0.

Additional details and impacted files
@@               Coverage Diff               @@
##           next-3_14_0    #4489      +/-   ##
===============================================
+ Coverage        93.29%   93.39%   +0.09%     
===============================================
  Files              207      207              
  Lines             5013     5013              
  Branches          1355     1354       -1     
===============================================
+ Hits              4677     4682       +5     
+ Misses             336      331       -5     
Flag Coverage Ξ”
unit-tests 93.39% <100.00%> (+0.09%) ⬆️
unit-tests-18.x-Linux 93.39% <100.00%> (+0.09%) ⬆️
unit-tests-20.x-Linux 93.39% <100.00%> (+0.09%) ⬆️
unit-tests-latest-Linux 93.39% <100.00%> (+0.09%) ⬆️

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

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@dubzzz dubzzz merged commit 60d0a30 into next-3_14_0 Nov 28, 2023
66 of 67 checks passed
@dubzzz dubzzz deleted the with-cause-default branch November 28, 2023 21:42
dubzzz added a commit that referenced this pull request Jan 2, 2024
**πŸ’₯ Breaking change**

Until now, fast-check have been merging the content and stack of the original Error that caused the property to fail into its own Error. With the recent (2022) introduction of cause on Errors, this complex logic can be dropped in favor of the native cause mechanism.

This PR makes cause mode the default. Before this PR, toggling it was possible via `errorWithCause: true` on `fc.assert`.

Given not all test runners properly support causes attached to the Error, we offer a fallback for users willing to preserve the old behaviour. It can be toggled via `includeErrorInReport: true` on `fc.assert`.

Related to #4416.
dubzzz added a commit that referenced this pull request May 16, 2024
**πŸ’₯ Breaking change**

Until now, fast-check have been merging the content and stack of the original Error that caused the property to fail into its own Error. With the recent (2022) introduction of cause on Errors, this complex logic can be dropped in favor of the native cause mechanism.

This PR makes cause mode the default. Before this PR, toggling it was possible via `errorWithCause: true` on `fc.assert`.

Given not all test runners properly support causes attached to the Error, we offer a fallback for users willing to preserve the old behaviour. It can be toggled via `includeErrorInReport: true` on `fc.assert`.

Related to #4416.
dubzzz added a commit that referenced this pull request May 17, 2024
**πŸ’₯ Breaking change**

Until now, fast-check have been merging the content and stack of the original Error that caused the property to fail into its own Error. With the recent (2022) introduction of cause on Errors, this complex logic can be dropped in favor of the native cause mechanism.

This PR makes cause mode the default. Before this PR, toggling it was possible via `errorWithCause: true` on `fc.assert`.

Given not all test runners properly support causes attached to the Error, we offer a fallback for users willing to preserve the old behaviour. It can be toggled via `includeErrorInReport: true` on `fc.assert`.

Related to #4416.
dubzzz added a commit that referenced this pull request May 17, 2024
dubzzz added a commit that referenced this pull request May 17, 2024
dubzzz added a commit that referenced this pull request May 29, 2024
**πŸ’₯ Breaking change**

Until now, fast-check have been merging the content and stack of the original Error that caused the property to fail into its own Error. With the recent (2022) introduction of cause on Errors, this complex logic can be dropped in favor of the native cause mechanism.

This PR makes cause mode the default. Before this PR, toggling it was possible via `errorWithCause: true` on `fc.assert`.

Given not all test runners properly support causes attached to the Error, we offer a fallback for users willing to preserve the old behaviour. It can be toggled via `includeErrorInReport: true` on `fc.assert`.

Related to #4416.
dubzzz added a commit that referenced this pull request Jul 16, 2024
**πŸ’₯ Breaking change**

Until now, fast-check have been merging the content and stack of the original Error that caused the property to fail into its own Error. With the recent (2022) introduction of cause on Errors, this complex logic can be dropped in favor of the native cause mechanism.

This PR makes cause mode the default. Before this PR, toggling it was possible via `errorWithCause: true` on `fc.assert`.

Given not all test runners properly support causes attached to the Error, we offer a fallback for users willing to preserve the old behaviour. It can be toggled via `includeErrorInReport: true` on `fc.assert`.

Related to #4416.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant