SIGN IN SIGN UP

[test] Remove the custom `toThrow` override for legacy V8 error messages (#37384)

The custom `toThrow` override in `scripts/jest/matchers/toThrow.js`
wrapped the built-in matcher to rewrite the pre-Node-17 V8 error message
format ("Cannot read property 'x' of undefined") into the modern one
("Cannot read properties of undefined (reading 'x')"), so the test suite
could run on Node 12 to 16.

On the Node versions this repo runs on (20 per `.nvmrc`, 24 in CI), V8
only ever produces the modern format, so the override is a passthrough.

Mostly removing this because the custom matcher deep-imports
`expect/build/toThrowMatchers`, which no longer resolves on Jest 30
because each Jest package is now bundled into a single file, so this
removal unblocks the Jest 30 upgrade stacked on top.

Co-authored-by: Claude Code (kimi-k3[1m]) <noreply@anthropic.com>
S
Sebastian "Sebbie" Silbermann committed
269bd40a953a5339ad47c643f9b9dbce88ab878d
Parent: a112448
Committed by GitHub <noreply@github.com> on 8/26/2026, 5:24:58 PM