Skip to content

fix(test): handle rejections between tests - #40158

Closed
deepshekhardas wants to merge 1 commit into
oven-sh:mainfrom
deepshekhardas:fix-34859-rejections-between-tests
Closed

deepshekhardas wants to merge 1 commit into
oven-sh:mainfrom
deepshekhardas:fix-34859-rejections-between-tests

Conversation

@deepshekhardas

Copy link
Copy Markdown

Fixes #34859

Handle rejections between tests correctly to avoid unhandled promise rejections leaking across test boundaries.

An unhandled rejection that escapes every test/hook (e.g. a file's
top-level async IIFE) was silently swallowed and the file passed. Report
it like an uncaught exception between tests: print the error and count
it so the file fails.

Fixes oven-sh#34859

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Your included review limit has been reached.

You’re in a promotional period — use the checkbox below to run this review for free:

  • Run review for free

On-demand reviews are free for the next 29 days. After that, they cost $0.25 per reviewed file.

How can I continue?

Run this review now using the option above, or comment @coderabbitai review --use-credits.

You can also wait for the limit to reset (next review available in 50 minutes), then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5a12034d-6846-44cd-bf84-9a0cad2a34ab

📥 Commits

Reviewing files that changed from the base of the PR and between 8eb5b6e and 6978ec8.

📒 Files selected for processing (2)
  • src/runtime/test_runner/jest.rs
  • test/cli/test/rejections-between-tests.test.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@robobun

robobun commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Thank you for the PR. This branch is the same commit (6978ec8) as #38898. #38898 was closed on August 15 in favor of #34862, and #34862 is still open for #34859. To keep one PR per issue in the review queue, I am closing this one as a duplicate of #34862.

As noted on #38898: the branch this change edits is the fallback for when no test file is active, so a rejection from a test file never reaches it. The shape the issue describes needs the runner to keep the event loop running after the module is evaluated, which is what #34862 does.

@robobun robobun closed this Aug 23, 2026
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.

bun test swallows unhandled rejections from a script file's async IIFE

2 participants