Skip to content

Fix process abort when expect matcher utils inspect a value whose custom inspect throws - #36912

Open
robobun wants to merge 1 commit into
mainfrom
farm/dd96bbaf/expect-matcher-utils-throwing-inspect
Open

Fix process abort when expect matcher utils inspect a value whose custom inspect throws#36912
robobun wants to merge 1 commit into
mainfrom
farm/dd96bbaf/expect-matcher-utils-throwing-inspect

test: make expect matcher utils throw catchably when inspecting a val…

7c2c1d3
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Aug 4, 2026 in 16m 25s

Code review found 1 important issue

Found 1 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 1
🟡 Nit 0
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important src/jsc/ConsoleObject.rs:5717-5730 Same panic class unfixed in test.each title formatting

Annotations

Check failure on line 5730 in src/jsc/ConsoleObject.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

Same panic class unfixed in test.each title formatting

The same panic is still live in `test.each` title formatting: `src/runtime/test_runner/jest.rs:713` (`$var` interpolation) and `jest.rs:790-791` (`%p`) both do `write!(&mut list, "{}", value.to_fmt(&mut formatter)).unwrap()` into a `Vec<u8>`, so `test.each([{ [Symbol.for('nodejs.util.inspect.custom')]() { throw 1 } }])('%p', () => {})` still aborts the process with the exact panic this PR fixes. `format_label` already returns `JsResult`, so both sites can switch to `formatter.format_value::<fals