Skip to content

feat(assert/unstable): allow asserting predicates against thrown/rejected errors #6629

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lionel-rowe
Copy link
Contributor

Closes #6592.

This also allows regexes to be used with assertThrows and assertThrows, for consistency with assertIsError.

Clean diffs against cloned versions of the stable files: d470af4...lionel-rowe:std:throws-rejects-predicate

@lionel-rowe lionel-rowe requested a review from kt3k as a code owner April 28, 2025 10:08
Copy link

codecov bot commented Apr 28, 2025

Codecov Report

Attention: Patch coverage is 98.11321% with 3 lines in your changes missing coverage. Please review.

Project coverage is 94.75%. Comparing base (096f0be) to head (477ecca).

Files with missing lines Patch % Lines
assert/unstable_rejects.ts 95.38% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #6629    +/-   ##
========================================
  Coverage   94.74%   94.75%            
========================================
  Files         583      586     +3     
  Lines       46478    46637   +159     
  Branches     6523     6572    +49     
========================================
+ Hits        44036    44191   +155     
- Misses       2399     2403     +4     
  Partials       43       43            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

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

Successfully merging this pull request may close these issues.

assertThrows and assertRejects: check properties of the thrown error other than message
1 participant