Ultimate

X_TEST_NUMBER_EXPECTED

Means

a matcher expected a finite number and got something else

Typical cause

toBeWithinBudget answered pass:false for a receiver that is not a number (NaN included), so .not.toBeWithinBudget passed on a Promise or undefined

Fix

expect(bytes).toBeWithinBudget(limit) — pass the measured number itself, e.g. (await Bun.file(path).arrayBuffer()).byteLength, never a Promise or a string

Listed under Testing

This page as markdown