-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
⚡️ Delay computation of Error stack when no cause #5584
Conversation
**💥 Breaking change** Up-to-now fast-check was always sealing the stack attached to errors as they popped. With error with cause capabilities we started to draft the required links to pass the instance of Error up to the end. We can thus safely delay the computation of the stack. As delaying might have unwanted side-effects (maybe our instance of Error would be touched), we prefer not to make this change as part of a minor release. Over all the breaking is justified by the change we do on the API of the failures. We dropped the previously precomputed errors and only keep the raw instance of errors. Users now have to manipulate it to extract the relevant error if needed. First piece for #4416
🦋 Changeset detectedLatest commit: 7f4631f The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Open in Stackblitz • @fast-check/examples @fast-check/ava
@fast-check/expect-type
fast-check
@fast-check/jest
@fast-check/packaged
@fast-check/poisoning
@fast-check/vitest
@fast-check/worker
commit: |
👋 A preview of the new documentation is available at: http://677ec8602d825e8419b810e3--dubzzz-fast-check.netlify.app |
…o pr-4472
👋 A preview of the new documentation is available at: http://677f8880b7517df9440e30af--dubzzz-fast-check.netlify.app |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5584 +/- ##
==========================================
- Coverage 94.91% 94.70% -0.21%
==========================================
Files 235 235
Lines 10043 10036 -7
Branches 2836 2823 -13
==========================================
- Hits 9532 9505 -27
- Misses 511 531 +20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Description
Up-to-now fast-check was always sealing the stack attached to errors as they popped. With error with cause capabilities we started to draft the required links to pass the instance of Error up to the end. We can thus safely delay the computation of the stack.
As delaying might have unwanted side-effects (maybe our instance of Error would be touched), we prefer not to make this change as part of a minor release.
Over all the breaking is justified by the change we do on the API of the failures. We dropped the previously precomputed errors and only keep the raw instance of errors. Users now have to manipulate it to extract the relevant error if needed.
First piece for #4416
Checklist — Don't delete this checklist and make sure you do the following before opening the PR
yarn bump
and flag the impacts properlyAdvanced
💥 Breaking change: Change property failure output